目录
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