3. März 2013
When I learned git and switched from SVN to git I had a lot of questions. After reading a lot of tutorials and getting warm with the commandline I still had another problem: how to do the command line commands in tortoise? Tortoise is still really cool for windows users, because it integrates so nicely with the windows explorer. But some features are a little bit hidden:
The SVN workflow is often simpler than git, so often the order is like this:
In the latest gui versions from tortoise svn these steps are bundled nicely: The SVN commit tool will parse the error line for "you have to update your working copy first" and will suggest to make an update. After the update (merge) has suceeded it opens the commit dialog again (with the previously entered commit message pre filled).
But how would this workflow would look like in git?
What I've learned is: If you always pull your changes to a git repository without working dir changes it's likely that git can fast forward your head branch. (You can read a really nice article if your familiar with graphs visual git guide about the topic). Fast forward is a good thing and merging is not such a good thing (You'll notice that the other team members of github will ask you to rebase your commits if you have too much merges in your history).
So if you haven't screwed up yet, go to the pull dialog an ALWAYS check:
only fast forward. (this is
--only-ff in the console). If you have screwed up, you'll get an error message: "branch xxx does not fast forward branch yyyy". This is aquivalent to "you have to update your working copy first" in SVN. When you tried to push I assume that you have commited everything. You will see your local commits in tortoise sync on your branch. Now go to the fetch dialog and tick
launch rebase after fetch. If you have tracked your remote branch the following will happen:
The flow is like this:
rebase after fetch)
You'll see that you're local history is like you expected it in svn.