So I have cloned a project at github and fixed a patch. Since this is the first time Im working in git Im trying to figure out the best way to put it online.
Upon checking out my own (cloned) repository on github there was only one branch: master. I created a branch, myfix, which now holds one commit, which is the fix for the bug.
- Should I now push everything to my cloned project on github? I assume that this would create the branch myfix on my github project containing that single fix commit.
- Should I merge myfix into the master branch, remove myfix and then push everything?
When searching online, it seems that the common/good practice is to leave master untouched, using that purely for pulling from the real/original public project repository (that is, others accepted contributions and such). But others suggest other strategies:
- Create an upstream branch, put your clean and ready contributions there so others can find them easy, not mixing it up with my other incomplete/experimental branches (I wonder why these would even be online if they were so incomplete).
- Create a downstream branch, pull others changes in here for offline merging.
If I follow the above two (currently feels a bit overkill though) what purpose would the master branch fill?
Git can do any combination (or all) of the above. This leaves me a bit confused as to how to easy show my work to others. Is there such a "common" workflow? Or is it every man for himself and you post a specific revision in a specific branch (thats pushed) in the issue tracker for the fixed bug?