An example repo. Clone, commit, send pull requests, and just get used to using git!
-
Make sure that your credentials are set up. If you are logged in using your GitHub account, the defaults should be good, but they don't take effect until you look at them. Click the settings button, then click update.
-
Clone (download) this repo. Click on CSLLC-Codeathon-2014 in the sidebar, then click "Clone" beside the repo you want to clone (which is obviously this one, or you wouldn't be reading this).
-
Find the repo in your local file system. GitHub will default to My Documents\GitHub.
-
Go back to your GitHub window. Click on "Local" in the sidebar and double-click on the repo.
-
Make a new "branch," or history path. Click at the top right, where it says "master." Then, type in a descriptive one-word name for the edit you will be doing. (In this tutorial, your username would be fine.) Hit enter, and you will have your own personal branch.
-
Change testFile.txt in any text editor. It's just a normal file, and GitHub doesn't care how you edit it.
-
There should be a dropdown at the top left next to "Uncommitted Changes." Click it.
-
You should now see a log of your changes on the right side of the screen. Make sure these are the changes that you want to make, then type a message to go in the history in the dropdown. The summary is necessary, but the longer description is not. When you're done with your message, click "Commit." A commit is just a point in history, so commit often!
-
Click "Publish" to send your branch to the website.
-
Now that you've made changes to your repo, you'll want to request it to be pulled into the main repo. On the GitHub website, find the repo. From the dropdown menu that says "branch: master," select your branch. Click the green button to submit a pull request. Give a reason why, then click "Create Pull Request."
-
Everyone in the group will be notified by email that you have submitted code. Someone can then review it and merge it in with the main stream.
-
Before making more changes, you'll want to start back from the master branch, because other people will probably have added more code. In your GitHub program, click the branch button, then click master.
-
Click "Sync" to synchronize your local master branch with the one on the website.
-
Start again with another branch!
You now know the very basics of using GitHub to collaborate! Have fun!
- Commit often!
- Don't do work in the master branch! Your master branch should always be a working copy of what is on the website. (This may change from project to project in the future, but follow this rule for now.)
- Sync with the website and make a new branch immediately before making any completely new change!
- Use descriptive branch names!
- Apply descriptive commit messages!
- DO NOT submit a pull request for every commit! Only submit a pull request when you've completed something that you know works and that completes the task you were working on.
Add instructions for GitHub for Mac.
Add instructions for command line git.
Add instructions for branching.