git常用指令

2022-03-11  本文已影响0人  VervertomJC

从命令行创建一个新的仓库
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin http://localhost:3000/tom/dy_iOS.git
git push -u origin master

从命令行推送已经创建的仓库
git remote add origin http://localhost:3000/tom/dy_iOS.git
git push -u origin master
//git 取消提交
git reset —hard <#commitId hash#>

本地与远程关联 强制
git pull <repo-name 远程地址> <branch> --allow-unrelated-histories
后面加上 --allow-unrelated-histories , 把两段不相干的 分支进行强行合并
后面再push就可以了

git add .
git commit -m "commmit msg"

上一篇 下一篇

猜你喜欢

热点阅读