Let's start fixing how we use git here in crew so our GitHub looks even more awesome and you all get experience working in a professional-like git environment.
How to use GitHub in the good ways
How do I develop in this newfangled method?
Everything you do should be related to an issue on GitHub. Let's go through the process of making one.
Making issues on GitHub
Notice how once you submit the issue, it gets a number? This number does a really cool thing for us later when we...
There are a couple ways of doing this, but the easiest is to push a branch you want to merge to the upstream repo:
$ git checkout dev # the branch we want to make changes based on
$ git fetch upstream # fetch all remote branches
* [new branch] lolwhatever -> upstream/lolwhatever
* [new branch] someone-elses-pull-request -> upstream/someone-elses-pull-request
$ git merge upstream/dev # merge the current work on the dev branch into our local copy
$ git checkout -b change-readme # checkout a new branch with a name that relates to what issue you are working on
Switched to a new branch 'change-readme'
$ vi README.md # make your changes and stuff
$ git status # always a good command to look at
On branch change-readme
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: README.md
$ git add README.md # add tracking to the changes you just made
$ git commit -m "Updated README.md to add info about xyz"
$ git push upstream change-readme # !!! this pushes your code to a new branch on the upstream repo
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 321 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To https://github.com/crew/dds-client.git
* [new branch] change-readme -> change-readme
On the GitHub side:
People should complain that you did things wrong at this point
You can comment directly on lines in the code, and you should. Unknown User (aliukani) helped me out here by telling me that I did something that isn't good.
Let's see exactly what he's talking about by viewing the code that he's complaining about:
Yeah, this wasn't what I wanted to do, I'm using too many characters because of code style and things. Let's go back to development and fix things up.
Make your code changes and commit them. Push the changes upstream when you're happy with your effort.
Notice how the pull request updates automagically! Ping your friends to look again and do more code review.
Look at how Unknown User (aliukani) added an approval label (you can make these by going to issues -> labels -> new label).
Hey Unknown User (alice) also approved! Now that we have a few (not zero or one!) people that think that this is good code and works.
Now a maintainer that is willing to put their name behind your code can endorse it and merge your pull request.
Now you can click the 'Delete branch' button and now you're done! It also closes the issue! Everyone is happy!
You may also want to use visual panels to communicate related information, tips or things users need to be aware of. |
|