Code snippets‎ > ‎Utilities‎ > ‎

Git repositories

Initialize a local git repository:
git init

Initialize a remote git repository:
git init --bare

Creating a link to a remote repository:

git remote add origin ssh://git@example.com/my_project.git

git push -u origin master

Checkout of a remote branch:
git checkout -b test origin/test

Add a file:
touch README
git add README
git commit -m "Initial commit." README

Clone a repository:
git clone  -m "Initial commit." README
Comments