Skip to content

Repository

Initialize Repository

Initialize any existing directory as a Git repository.

git init

Download Repository

Download an entire repository from any location.

git clone <path-or-url-to-repository>

Remote Repositories

Show all configured remotes.

git remote -v

Create a new connection to a remote repository. After adding you can use <shortname> as a shortcut for <url> in other commands.

git remote add <shortname> <url>

Fetches remote refs. Do this before actually pulling all changes to local.

git fetch

Options git fetch

<remote> fetch from a secific remote repository <branch> fetch only one branch, not all remote refs

Fetches remote copy of current branch and immediatly merge it into local copy.

git pull

Options git pull

<remote> fetch from a secific remote repository

Push curent branch to remote repository including all necessary commits and objects. This automatically creates a new remote branch if it doesn't exist.

git push

Options git push

<remote> push to a secific remote repository
<branch> push specific branch