Live data from Hacker News

Learn Git Branching

pcottle.github.com

11–20 of 144 posts

Re: Learn Git Branching

#13
post #8

I don't get how it works.

You can: - 'git checkout -b branch_name' to create a branch - 'git checkout branch_name' to switch branches - 'git commit' to add dummy commits (no need to git add stuff) Edit: formatting

You can also:

-'git rebase branch_name'

-'git merge branch_name'

-'git checkout C6' to enter a detached head state

Re: Learn Git Branching

#15
Absolutely fantastic tutorial, but as most other people here have mentioned there should probably be some indication that you should type help to get started.

Re: Learn Git Branching

#16

Excellent work! I've wanted an easy way to explain git branching to people and from now on I'll point them to this.

Same! Sometimes I would like to introduce my coworkers to the amazing world of git, but it's hard to convince them without showing them a concrete example, this one is a pretty nice overview, and also useful for advanced users! I just got a better, more intuitive understanding of what detached HEAD really means thanks to it!

Re: Learn Git Branching

#17
post #2

It would be great if the help page popped up when I first load the site, so I don't have to guess and type "help" at the prompt to find out the purpose of the site. :)

I didn't even realise you could type "help". There definitely needs to be some sort of introduction prompt otherwise people (like me) are just gonna leave feeling like they've learned nothing. Still, nice idea.

Agreed. I'm like you and I was just committing, branching, and merging but learning nothing while clicking around. I'm glad I know now though because I can totally use a lesson on branching. I think branching in Git is one of the most misunderstood parts of Git. I can't tell you how many times I've almost screwed up a repo because I made some mistake merging branches and not pulling from the correct branch when working on a different machine. To make matters worse, if you use Git to deploy into production, testing, and staging environments like I do you run the risk of pushing development or untested code into production by accident. I know I've definitely pushed code meant only for one branch (or feature) into production without merging with master... it gets confusing but needless to say it didn't take long before things stopped working and I realized my mistake.

Branching is huge, awesome, powerful, but I know I as well as a lot of developers I know could use a good lesson on it.

Re: Learn Git Branching

#19
very nice idea. when/if this supports git push i'll come back and play some more. i'm a total git noob, git makes me crazy and maybe this will help clarify things for me.

Re: Learn Git Branching

#20
post #8

I don't get how it works.

You can: - 'git checkout -b branch_name' to create a branch - 'git checkout branch_name' to switch branches - 'git commit' to add dummy commits (no need to git add stuff) Edit: formatting

Congrats, you just gave a more helpful introduction than the page. :-)
Post reply on HN