This is a quick start for Github. If you want an explanation of the concepts, please go to Git.
- 1 What is Github?
- 2 Preparation (SSH Key)
- 3 Working on a repository using Github's text editor
- 4 Working on your own local machine
- 5 Git Commands
- 6 See also
- 7 External Links
What is Github?
Github is a website and service that hosts Git repositories. Public repositories can be created for free. Private repositories require users to pay for an account.
In order to use Github.com, you need to have an account.
- Go register now: https://github.com/join
Preparation (SSH Key)
In general, you will be working from your own computer.
- You need a SSH key pair
- SSH Key - Go here to learn more about how to create a pair.
- Once you have created a pair, then you can connect your local computer with Github.
Go to Github and add your SSH key. ("Add SSH Key")
Working on a repository using Github's text editor
In this case, you will make edits directly in Github, without creating and cloning the repository on your local machine.
Working on your own local machine
- Create an account
- Linking SSH Keys
Actual First Time Workflow
- Git Clone (or create)
Actual Second Time Workflow
- Git Diff (to see unfinished work)
- Git Pull
- Git Checkout
- (change your stuff)
- Git Add (for changed and new files)
- Git Rm (for removing)
- Git Mv (for renaming)
- Git Status (for seeing untracked files)
- Git Commit (commits changes locally)
- Git Push (puts your changes on the server)
This is random list of Git Commands.
git clone email@example.com:'''yourusername/yourrepository'''.git
Cloning your repository. Go get the repository.
This shows what changes have taken place recently.
git checkout (name of branch)
This switches your repository to the specific branch.
git checkout namename
This switches your repository to the specific branch called namename.
This will show you the different branches.
This shows which files have changed or been added, but not committed to the repository.
This shows the differences of any changed files that have not been added.
git config --global push.default simple
This configures git to do something. In this case, this is changing the global something.
git remote -v
This shows where the origin is.
git remote add origin https://github.com/blahblah/blahblah.git
This is example of how you would link to a specific Github repository.
git pull --all
This downloads the latest set of changes to your repository.
git pull origin master
This downloads the code from the master branch.
This pushes changes the code back to the main repository.
git push -u origin master
This would push your changes to the origin master branch.
git diff HEAD
Shows the differences between the head and the working copy.
git diff --staged
git reset filefile
This resets the file that you're working on.
Git Branch Clean Up
git branch clean_up
Oh jebus, don't use this. This throws away your changes.
git merge branchbranchname
This merges the changes into the branch.