This is a quick-and-dirty guide for working with Git from the MacOSX Terminal.
Working with Github is great for version control and collaborating on projects.
Yet, many of my project partners have expressed fear about working with Github and especially working with the Terminal.
Fortunately, you only need to know a few basic steps to use Git smoothly and effectively.
This is for new users to Github.
The users should have some familiarity to coding, but this is not exactly needed.
These steps are meant for co-equal collaborators. They will work with Forks, but the beginning part is a little different.
Disclaimer: These guidelines are for Mac OSX users, but I believe are easily transferrable to Windows.
Copy clone https link from Github
e.g. https://github.com/niklaslollo/niklaslollo.github.io.git
Navigate to chosen location using terminal cd <folder>/<folder>/
Clone it:
git clone <link>
You will want to check status early and often. Do this between each step as you get used to working with git.
The terminal will return a response detailing what is happening and provide suggestions for what you might want to do.
git status
You will want to work on a branch of the master, then merge it later.
git checkout -b <branchname>
To navigate around branches:
git checkout <branchname>
You will want to send your updates to the branch on which you were working. Use the status check to figure out which branch you are on.
Add files or updates
git add .
adds every possible update in your repo. Recommended
git add <file>
adds only that file or its updates.
Commit and add a message
git commit -m "message"
Try to be succinct, but descriptive in your message. This tags the update for future reference.
Push to github
git push
Create pull request from your branch on Github.
Another partner reviews and decides whether to merge or ask for edits.
Assuming it passes the review, that partner accepts and merges the branch with Master. Then the branch should be deleted on Github.
Delete local branch using Terminal.
git branch -d <branch_name>