The problem is that you're giving up. You have to have the mindset that you will do something you set out to accomplish, and that giving up is not an option. Why give up? It's definitely not because it's not possible. Because you find it hard? So what? Just learn a little a time.
I recommend the book "Pro Git". The first 4-5 chapters are enough to use git in real world (e.g., workplace) projects.
Also, learn about "git-flow", and use it as a crutch to make git easier at first. It's a workflow you can read about online, and there are a set of scripts you can install that implement it. After a while you will start to use git without git-flow and abandon the git flow scripts, but probably keep the workflow concepts. This is what I did.
EDIT: Here is the description of git-flow that I initially found useful. I haven't read it since, so I'm not sure what my take on it would be at this point. But the graphics are better than what you get on the Atlassian site, which is the first google result when you google "git-flow".
Definitely agree there, I guess I give up on it because it's not a necessity for what I do (I already have something that works for my purposes). Grabbing pro git for kindle now and I'll check out git-flow too. Appreciate the suggestions! (everyone elses suggestions too)
Note that git-flow has some administrative overhead. I vastly prefer the GitHub Flow variant for most personal projects. My colleagues are less disciplined with version control and frequently push half commits, so for work I fall back to a lightweight variant of git-flow that doesn't use release branches.
Do you have a solid CS background? The article git for computer scientists made it all finally click for me. The key I was missing is that a git repo -- or even the collection of instances of the same git repo on multiple people's machines -- is just a directed acyclic graph. And git commands manipulate that graph.
Once I understood that, I instantly knew how to do fairly fancy things such as merging previously separate repositories.
I find it easier than subversion. At least, the workflow easier anyway. It's pretty simple to make a branch do your thing then merge the branch with the trunk. It only takes like 4 commands to do all of that.
I think most of the difficulty is trying to do tasks that are "optional" (ie, not needed for ideal usage of the program, but you will need at some time). For example, how do I stop git from making my scripts non-executable? Fortunately, there's absolutely no reason to remember (learn) these kinds of things. Just google when you need them. I still haven't memorized the syntax to restore a single file from an older commit, but I know where to find the command when I need it.
Pretty much all you need to memorize is:
Cloning (getting a new repo from the internet)
Checkout (switching branches)
Pulling (getting changes from remote repo)
Pushing (adding your changes to the remote repo)
Diffing (viewing changes you've made, or changes between commits, branches, etc)
Checking the status (to see which files are changed, etc)
Adding (staging files to commit)
Commiting (creating a revision with staged files)
Branching (creating a new branch)
My advice when going from SVN to git is to FORGET EVERYTHING ABOUT SVN! If you try and apply existing knowledge about SVN to git, it will bite you in the ass. So don't assume that because you're competent with SVN that you know anything about git. This will stop misconceptions from hindering your learning.
I've heard this suggestion before, but my motivation to learn git is so I can use and contribute to projects on github, and potentially use it for my own projects if it offers me any benefits (which people are telling me it does).
Both Mercurial and Git have adequate bridges for each other, and are conceptually so similar that it really makes little difference in the end. But I started with Mercurial, and now firmly believe both that Git's model is saner and that Mercurial's UI mostly isn't any better than Git's.
I also believe DVCS to be strictly superior to CVCS for most things but there are issues inherent to DVCS that lead to problem areas. Undiffable files are a prime example, so, for instance, artists, would not likely benefit from DVCS at all. But for source control, DVCS do everything Subversion does, only better and faster.
I started with Mercurial before learning Git and I felt like Mercurial was an easy transition from SVN while still giving me a good grasp on the concepts needed to understand Git. http://hginit.com/ is a really good place to understand Mercurial. Maybe even just reading through that and then learning Git would be enough to get you there?
There are two big things to adjust to when switching from svn to git.
The first is the decentralized model. You should learn Mercurial because the command set it uses is way way more sane when coming from svn. Learning Mercurial will help you get comfortable with the distributed workflow with a relatively low barrier to entry from svn.
The second is git's command set. It's schizophrenic and a good number of the commands have names that are unexpected given what they do and what many other tools call the same operation.
I don't think you could avoid ever running into a time where you need to use git to work on a project, unless you literally never work with other people or work on an existing project.
Atlassian has pretty good Git resources. You could start using Sourcetree and do everything in the GUI to help you learn. The best resource is to just jump in and start using it and check stackoverflow when you hit a roadbump.
Why? They aren't that different. I started with the github tutorial. I also learned svn first, now I could never go back. You can even use an svn repo from git.
I think the issue is if you're trying to do tons of fancy things in git or just need the basic.
I've found the four most basic commands you need are git status, git add, git commit, and git push, and the flags I commonly use with them...for the rest, I Google as needed.
Obviously you'll need a few more than those as your basic toolkit (git clone, git checkout) but you can get pretty far with those depending on your use case.
I like this tutorial when I need to read up on a functionality instead of just quickly Googling for a command or a flag.
12
u/cakes Feb 06 '15
Is there any good resource out there for learning to use git? I've tried about 4 times, and always say "fuck it" and go back to using subversion.