Tracker website and (another) git workflow

Tracker is under a massive refactoring phase for the release of the 0.7.x series and there is a lot of work carried out. So to catch up and to give better info we started to work on the website to update the info over there.

Look at our new shiny development page where you can find the details and how to install tracker from the source with all the packages that you need in a debian based distro. BTW if you know what you have to install in Fedora and friends just let us know and we are going to add them in no time.

Anyway, I started this post to highlight another hint on how to use git (and where to find later when I will forget…)

The good news is Tshepang stated to contribute to the tracker website (source tracker website – if you feel like patches are always welcomed and yes you have to download all the gnomeweb-wml module).

Before today I always used git as a stand alone developer, but now I had to figure out how to track the changes in the master form the other projects, without losing all my work and the patches.

So here is the solution of this riddle.

From the master create your own branch

git checkout -b WIP

apply the patch and work on the branch

git am 0001-super_patch.patch

hack hack hack

git commit -am "A lot of good stuff"

Now you ready to go. You want to put back your changes in the master and then push on the server.

How to do that?

You must rebase your local Work In Progress branch with the local master that track the remote master. eh? yeah. Let’s go through the command:

git checkout master #Back in master

git pull # Grab all the new updates

git checkout WIP # Back in WIP

git rebase master #The Black magic. Commit all you change on top of the master ones

and now you good to go:

git checkout master # Back in master
git merge WIP # It’s gonna be a fast foward merge so no commit message will be created; that is exactly what you want, because the meaningful commits’ messages are in the WIP branch and a commit with the message “merged WIP” is not that interesting.

git push # And we go online. 🙂

On a side note:
gitg is your friend.

gitg screenshot

gitg screenshot

3 Comments

  1. I didn’t know you were a tracker developer!!
    Congratulations!! 🙂

  2. And also thank you for the instructions on how to rebase a branch with git. I used to do it with a mix of git fetch/merge, but it is not the optimum.

    What happens if there are conflicts between your branch and the one you are merging from? Which tool do you use to manage conflicts?

  3. well if there are conflicts you want to solve them in your local branch using gitmergetool.

    if you have meld installed git automatically fire it up in the 3 way mode and you can understand what you have to do.

    It happens once and worked quite well 🙂

Leave a Reply