面试常问问题——常用Git命令

1、git clone  <url>     #克隆一个远程仓库

2、git add .              # 提交修改到暂存区

3、git commit  -m "提交信息"     # 提交更改

4、git reset <file>     # 删除暂存区的文件

5、git branch       # 显示分支

6、git  checkout -b <branch>   # 创建一个分支并切换过去

7、git checkout <branch>     # 切换分支

8、git rebase    # 将当前分支变基到目标分支

9、git reset      # 丢弃某些本地提交

10、git merge      #  将指定分支的更改合并到当前分支

posted @ 2024-04-09 15:01  Alieen617  阅读(78)  评论(0)    收藏  举报