Everytime you work on a task, create a new branch for it. This helps you make sure that you don't break the current master branch, and you can isolate all your code to just your own.
Get the design docs here
Here is how you create a new branch:
git checkout masterif you aren't already on master.git pullso you can get the latest code.git checkout -b [new_branch_name]so you can create a new branch named[new_branch_name](replace[new_branch_name]with any name that makes sense.) Note:-bis the flag that lets you create a new branch. If you forget to type-bthen git will complain.- You should now be on your new branch. Type
git branchto verify where you are. - Start coding!
Try to organize your thinking so that you can make changes or write code in small steps. When you think you have made a change or written a piece of code that is "correct" and you feel comfortable saving your progress, here's how to do a commit:
git statusto see what files you've changed.git add .to add all of the files you want to save your progress on (yes, that's a dot at the end).git commit -m "some message here"to commit your changes (meaning, saving your progress).
You can also use the github client, if you feel more comfortable with that (I use it a lot too).
When you're done, you want to "sync" your branch, meaning update the remote repo, here's what you do:
In the github client:
- Click "sync" or "publish"
On the terminal:
git statusto see if you have any uncommited changes. If you do, commit them (see During your task above)git push origin HEADto "push" up your branch