常用git命令
用法可自行搜索 ---------------------------------------------- git checkout .(撤回到上次操作) git status (查看git状态) git clone (克隆代码) git fetch (拉取远端代码) git pull (拉取远端代码代码) git rebase (把一个分支的修改合并到当前分支) git merge (把一个分支的修改合并到当前分支) git push (提交代码) git reflog (查看所有分支的所有操作) git stash (保存代码到暂存区)
工作提交代码流程
1. git stash // 保存代码到暂存区 2. git fetch // 拉取项目远端代码 3. git rebase // 合并代码 4. git stash pop // 获取到最近一次stash进去的内容 5. git add . // 将工作区的内容提交到暂存区 6. git commit -m ‘commit’ // 提交备注 7. git push // 提交代码
普通提交
8. git add . 9. git commit -m '' 10. git fetch 11. git rebase
如果提交时不想提交某个文件,使用
git update-index --assume-unchanged xxx
以前只会 add commit pull push,这是自己在工作中学习到的
希望对你们有帮助,不要只会用add commit pull push啦