This is a mirror of official site: http://jasper-net.blogspot.com/

Pitfalls and Lessons Learned when switching from SVN to GIT

| Wednesday, December 22, 2010
This is not Git howto, it just describes where our team had trouble when starting our current project in Git.

Git is not SVN

Just forget everything you know about SVN. Start over with a fresh mind. Ok checking out and commiting are still similar, but when working with branches and tags, it's a whole new world.
Take a look at the Git cheatsheet: https://Git.wiki.kernel.org/index.php/GitCheatSheet

Don't get confused by the many commands, you'll get there. Starting Git is not that complicated.

Play around

You don't need much give Git a spin. Install it, work with it in a local repository. There is plenty of information out which will show you how to do so. Try everything you need to do in your daily work life. Merge, branch, tag .....
The only important thing is: work on the command line. After you got everything figured out you can use your IDE as an aide.

Watch out, branches

Here's the first thing i stumbled on. I was working on two branches, both not too different. Let's call the brA and brB.
So after creating to files in brA, I switch to brB to test something. I was wondering, why brB did have the same files and modifications I just did in brA.
Long story short. Never switch away from a dirty state, unless you know what you're doing.
What happened? Before switching away from brA, I had my repo in a "dirty state". That means, I had changes I did not commit to my working tree. These files will "follow" me to whereever I go.
This is actually very useful, if you want to test if a fix or change you made works in different scenarios before you commit it. But sometimes you do not want this behavior. So there are two options to avoid it. If you're sure you want the code in the branch, commit it. Otherwise stash it. There's a nice post to stashing on ariejan's site.

Read more: United Coders

Posted via email from .NET Info

0 comments: