一半君的总结纸

听话只听一半君

Git BitBucket 常用命令

bare repo和普通repo : bare repo是只含.git文件夹,放在centralized server上,这样所有人push的时候不会把自己本地的branch push上去影响到别人

www.saintsjd.com/2011/01/what-is-a-bare-git-repository/

cd /path/to/my/repo
git remote add origin ssh://git@bitbucket.org/username/myrepo.git

显示所有tracked files

git ls-files

从remote branch创建local branch (tracking branch)

git fetch origin (可能需要先)
git checkout --track origin/serverfix 

让已经存在的local branch foo track upstream/foo

git branch -u upstream/foo foo 

把local branch push到remote repo

git push -u origin foo
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: