Intro to Git & GitHub
By Sean O’Mahoney
Git vs GitHub
What? (GitHub)
“Founded in 2007, GitHub has brought millions of developers together to discover, share, and build better software.” – GitHub
Setting up Git
Using Git
1
To create a new repository where we are, we’ll run “git init”
2
Now we can create files and modify them, but to add them to git, we run “git add *”
3
To stage a change, to add a point in time, we run: git commit -m "Commit message“
4
If we’ve made any mistakes and wish to go back a commit, we can run “git revert”
Sign-up to GitHub
Now we’ll push our repo’ to a remote server, GitHub, meaning we’ll need an account
Git -> GitHub
Rinse & Repeat (for Simple Projects)
Branching
Branches are essentially a copy of a point in time of your repo, then worked on separately, we have referred to “master” before, and this is the main branch you create and work on.
But lets say you want to test code out before making it live on the master branch, or someone else wants to use your project, either modifying it for their needs or adding more, then we’d have a branch of the repo’
Forking (Cloning in Git)
This is the action made creating a new branch, but is used to refer to when you “fork”/clone someone else's repo’ (which you will likely not have permission to commit changes to)
Student Developer Pack - GitHub Education
2014 @ https://blog.github.com/2014-10-07-the-best-developer-tools-now-free-for-students/
Resources & Useful Links