Just a place for me to learn git without messing something up :p
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
testfile

README.md

Learning Git(Hub) Commands and Features.

Command Reference

Setup

git init

...initialises a (local) directory into a git repository.

git clone git@github.com/username/repository.git

will clone a remote repository into the current working directory.

To connect a local repository that wasn't cloned from a remote to its remote counterpart so that you can push to it, we use:

git remote add origin <server>

Branches

We can view, create, delete and switch between branches using:

git branch
git checkout -b <branch>
git branch -d <branch>
git checkout <branch>

Committing changes

To check if there have been any changes to files in the staging area since the last commit, we use:

git status

To add changed files to a commit for pushing to the online repository:

git add <filename>
git commit -m "message"

...where "message" is the commit summary message. Can use a * instead of specific filename to add all changed files to a commit. If we know we want to commit all changed files, we can use the -a flag in the commit command, and leave out the add step entirely

To push the commit to the remote server, we run:

git push origin <branch>

...where "branch" is source branch you're pushing to (defaults to master).

Tutorials & Cheatsheets

Markdown Stuff

Useful links: