本文主要是介绍knowledge_git,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
目录
- knowledge_git
- 1 vc => version control
- 2 git clone -b dev remoteRepository
- 3 将github仓库代码同步到本地
- 4 Git设置当前分支为默认push/pull分支
- 5
- 6
- 7
knowledge_git
1 vc => version control
2 git clone -b dev remoteRepository
git push -u -f origin dev
git push
git reset --hard e443f89e5f32ac6488dac02f3a175d3e493a6f58
3 将github仓库代码同步到本地
- 将本地公钥放到github上
- github上新建仓库 bd
git remote add git@github.com:mediocrePeople/bd.git
git pull origin main --allow-unrelated-histories # origin是桥梁名称
git pull "桥梁名称" master --allow-unrelated-histories
4 Git设置当前分支为默认push/pull分支
# 方法1,第一次推送到远程仓库时加上参数--set-upstream
git push --set-upstream origin main
# 方法2,未测试
git config --global push.default "current"
5
6
7
这篇关于knowledge_git的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!