Git
# 使用现有仓库提交代码
- 克隆仓库
$ git clone git@192.168.xxx.xxx:xxx.git
1
1
# 修改分支名
TODO:将分支名称为
oldbranch
改为newbranch
将本地分支oldbranch切一个分支到本地
git branch -m oldbranch newbranch
11删除远程分支
git push --delete origin oldbranch
11将本地新分支推送到远程
git push origin newbranch
11Finished
- 查看所有分支:
git branch -a
- 查看当前分支:
git branch
- 切换分支:
git checkout branchName
# 新建分支
新建:
git checkout newName --新建新分支 git checkout -b newName --新建并切换分支
1
21
2提交该分支到远程仓库
git push origin newName
11链接分支
git branch --set-upstream-to=origin/newName
11取消对master的跟踪
git branch --unset-upstream master
11
# 常见问题
# fatal: unable to access 'https://github.com/***/***.git/': GnuTLS recv error (-54): Error in the pull function.
解决方案:
//取消http代理
git config --global --unset http.proxy
//取消https代理
git config --global --unset https.proxy
1
2
3
4
2
3
4
1
2
3
4
2
3
4
Last updated: 2022/12/04, 13:58:10
← XCode