#Git

创建本地分支

1
git branch NAME

切换本地分支

1
git checkout NAME

查看远程分支

1
git branch -r

推送本地分支到远程仓库

1
git push origin NAME

引用子模块

1
2
3
git submodule add RESPOSITORIES PATH
# RESPOSSITORIES 是仓库地址
# PATH是本地路径,默认是当前目录

克隆带有子模块的项目

1
2
3
4
git clone XXX
cd XXX
git submodule init
git submodule update

跟踪其他分支

1
2
3
4
5
git remote add upstream XXX.git
git fetch upstream
git checkout master
git rebase upstream/master
git push -f origin master
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×