- 查看当前分支: git branch
- 切换分支:git checkout 分支名字
- 新建分支:git branch 分支名字
- 删除本地分支:git branch -d 分支名字(-D 强制删除)
- 提交创建的分支到远程:git push origin 分支名字
- 删除远程分支:git push -d origin 分支名字
- 提交到暂存区: git add .
- 提交到本地仓库:git commit -m "注释"
- 提交到远程服务器:git push origin 分支名字
- 拉取远程服务器的代码到本地:git pull origin 分支名字
- 本地修改暂存:git stash 或 git stash save "暂存的名字"
- 查看暂存列表:git stash list
- 切换到某个暂存:git stash pop stash@{index} 此操作会删除对应暂存
- 放弃本地修改,未提交和暂存:git checkout -- filepathname
- 查看状态:git status
- git restore --staged <file>命令,把文件从暂存区撤回到工作区,保留文件最后一次修改的内容
- git restore <file>命令,会撤销文件的修改,使文件恢复到暂存区或本地代码库(取决于文件在修改前的状态)
posted @
2021-12-14 17:46
陈娟
阅读(
614)
评论()
收藏
举报