This screencast covers:
git clone <repository address goes here>
Creates a local copy of the repositorygit status
Tells you which files have changedgit status -s
A "short" version ofgit status
that is more concise
git log
Shows the log of commits with their messages, dates and usersgit add <file name goes here>
Adds a file or directory to the set of changes that will be applied when you commitgit commit -m "<Your message goes here>"
Commits the changes you have added so far to your local repository (on your computer)git commit -m "<Your message goes here>" -a
The-a
option automatically adds all modified files. This is equivalent to first invokinggit add
for each changed file, then committing.
git push
Pushes your local commits to GitHub, making GitHub contain the same changed files that are on your computergit push origin master
The full form ofgit push
that is assumed.origin
refers to GitHub, andmaster
refers to the master branch (the default main branch that is automatically created with the repository).
git pull
Pulls the remote changes from GitHub down to your computer. Shorthand forgit fetch
gets the changes from GitHub to your computer, but does not change the files you seegit merge origin/master
merges the remote changes into the files you see
git branch
Lists branches and shows the currently checked out branchgit branch <new branch name>
Creates a new branchgit branch -d <new branch name>
Deletes a branch
git checkout <branch name goes here>
Checks out a branchgit checkout -b <new branch name>
Creates and checks out a branch
- Make a new branch called
gh-pages
using either of the following:git branch gh-pages; git checkout gh-pages
git checkout -b gh-pages
- Push the
gh-pages
branch to GitHub using:git push origin gh-pages
- Access the page at
http://<user name>.github.io/<repository name>/
Below are links to specific times in the video that explain each step.
- Creating a new repository in GitHub
- Install Git on your system
- Setting up SSH keys (you don't need to do this if you use the HTTPs protocol rather than SSH, but with HTTPS you'll need to enter your user name and password each time you push)
- Cloning a repository
- Using git status
- Using git add
- Committing files
- Configuring your user name and email with Git
- Pushing changes to GitHub
- GitHub Pages
- Creating the gh-pages branch
- Checking out the gh-pages branch
- Pushing the gh-pages branch to GitHub
- Adding an index.html file
- Updating index.html and adding a JavaScript file (full Git workflow cycle)
Mind Blown Gif used in video.
Curran Kelleher, 9/9/2014