HPR2664: My git workflow
My git workflow
In this episode of HPR I present the workflow I use to contribute to opensource projects using git. I have no idea if this workflow is something that is commonly used, but it is working for me, so I thought I’d share it with the HPR community.
The first thing I do is fork the project I want to contribute to. This is done on github most of the time, although this workflow can work on gitlab, bitbucket, or even some self hosted git platform.
Once the project is forked, I clone it on my machine :
$ git clone git://server/path/to/myproject.git
Git automatically names my remote project origin.
Then I add a reference to the original project :
$ git remote add upstream https://server/path/to/originalproject.git
Now my local repository references my fork under the name origin and the original project under the name upstream.
In this workflow, I never work on the master branch. So, when I need to fix a bug for example, I create a new branch :
$ git checkout -b bugfix
I can then
Comments