This is just a quick guide to how to use Git and Github. I found it a little difficult to find a good guide to get started. There are many resources available but they explain it a little differently.
This is just my opinion and the way I am using git and githum so…YMMV.
Git and Github are 2 parts of a technology for source code version control.
Git is used locally on a computer and tracks the changes that are been made to files in a
project. It can be used in a distributed fashion but I don’t think many people use it that way.
GitHub is an online repository where Git controlled files can be stored.
Git and Github work together to provide a way to manage version controlled files for both individuals and teams.
Andrew McWilliam has a great post about the differences between Git and Github, it’s worth a read.
The basic process for using git/github on a project are:
- Create a remote repository (at Github)
- Go to https://github.com/
- Create an account
- Create a new repo
- Click the ‘Clone’ button and copy the path to the clipboard
- Clone the remote repo to your local machine
git clone https://github.com/user/repo-name.git
- Git will create a new folder using the repo name
- Create/change files
- Just create and modify files like you normally would
- Save your changes to the local repo (git commit)
git add . - stages all changed file so they can be commited
git commit -m "A message describing the changes"
- Push the local commit to the Github repo (git push)
Have a question or perhaps a correction? Feel free to contact me at email@example.com.