工具🔧

git 命令总结(持续更新)

2021-05-10  本文已影响0人  90后的晨仔
git init
git add  file
git add file1 file2 file3
git add file1
git add file2
git add file2
git add . 或者  git add --all
git add  testFolder (文件夹名称)
git commit -m "add new file"
git remote add origin https://github.com/624990742/JCMaNongChenZaiTest.git
git pull origin master

添加了-u参数,以后即可直接用git push 代替git push origin master。

git push -u origin master 

git rm 'JCMaNongChenZaiTest/Classes/ReplaceMe.m'删除指定文件
git restore 'JCMaNongChenZaiTest/Classes/ReplaceMe.m'恢复指定文件
git checkout master 切换分支到master
git merge hotfix 合并分支
git merge master --allow-unrelated-histor若两个库没关联在后边加 --allow-unrelated-histor

上一篇下一篇

猜你喜欢

热点阅读