2009年10月1日星期四

my git notes

install git in debian:
sudo aptitude install git-core

create a git repo:
git init

create a bare repo:
git init --bare

now, the git head is
ref: refs/heads/master

add new files
git add new-file1 new-file2 ...

commit to the repo:
git commit -m "message"

delete files
git rm file1 file2

new branch:
git branch new-branch1

switch branch
git checkout branch1

move file
git mv file1 file2

add remote repo:
git remote add origin ssh://server/path/repo

push to origin remote
git push origin master (first time)
git push (after)

没有评论:

发表评论