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.
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:
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?
GitHub defines a Contributor as: "This user has previously committed to the <repo name> repository." I think that generally means a merged pull request (In other words, a contributor is more than someone who "wants to contribute," but someone who has contributed already).
Whenever you commit to a project's default branch or the gh-pages branch, open an issue, or propose a Pull Request, we'll count that as a contribution. Repositories are sorted by your recent impact. A commit today is worth more than a commit last week.
Making a pull request To do so, head on over to the repository on GitHub where your project lives. For this example, it would be at https://www.github.com/<your_username>/Spoon-Knife . You'll see a banner indicating that your branch is one commit ahead of octocat:main . Click Contribute and then Open a pull request.
When you clone a repository, Git automatically creates remote tracking branches that do what you describe for the master branch. You can list these remote tracking branches with:
git branch -r
Because tracking the upstream repository is already done for you, you would normally use your master branch for mainline changes to the project. Here's what I would do in your particular situation:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With