Learning Git(Hub) Commands and Features.
...initialises a (local) directory into a git repository.
git clone email@example.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>
We can view, create, delete and switch between branches using:
git branch git checkout -b <branch> git branch -d <branch> git checkout <branch>
To check if there have been any changes to files in the staging area since the last commit, we use:
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