2010-12-09

A Git guide for myself

by Forrest Sheng Bao http://fsbao.net

If you are referring this doc, you need to replace all capitalized letters by "real" letters.

First, initialize Git and clone (formally fetch) existing code from Git server to local. When prompted, enter the password.

$ git init
Initialized empty Git repository in /home/forrest/forrest/work/BME/CTF_SAM_OUT/Code/.git/
$ git clone ssh://USERNAME@PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME/REPONAME
Initialized empty Git repository in /home/forrest/forrest/work/BME/CTF_SAM_OUT/Code/REPNAME/.git/
$ cd REPNAME/
$ git config user.name "YOUR NAME"
$ git config user.email "USERNAME@users.sf.net"

Move code you plan to push to Git server to current directory and add a push comment to them (like Summary in MediaWiki).

$ cp ../*.m .
$ git add *
$ git commit

Push them into Git server finally.
$ git remote add origin ssh://USERNAME@PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME/REPONAME
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master
$ git push origin master

Done.

Reference: http://sourceforge.net/apps/trac/sourceforge/wiki/Git

No comments: