How To Start ANew Git Repository

From Biowiki
Revision as of 22:42, 1 January 2017 by Move page script (talk | contribs) (Move page script moved page HowToStartANewGitRepository to How To Start ANew Git Repository: Rename from TWiki to MediaWiki style)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to start a new git repository on

First, ssh into and create an empty directory with group write permissions, group sticky bit, and suffix .git

cd /nfs/git
mkdir newrepo.git
chmod g+ws newrepo.git

Now, make it into a git repository

cd newrepo.git
git --bare init

Now logout of and, on your local machine, do the following to check out the (empty) repository

git clone

Now you can cd into the new repository, add a file, and do your first commit & push (for this first push, you need to specify the branch, hence the "origin master")

cd newrepo
touch README
git add README
git commit -m "First commit"
git push origin master

For subsequent pushes you don't need to specify the branch

touch DUMMY
git add DUMMY
git commit -m "Second commit"
git push

-- Ian Holmes - 20 Oct 2011