美文网首页
GIT 常用命令

GIT 常用命令

作者: chenjieyi | 来源:发表于2021-05-06 10:11 被阅读0次

1.git branch -a 查看所有分支

  1. git checkout [分支] 切换分支,如没有则新建分支

    git checkout [commitId] [文件相对路径] 某个文件回滚到某个版本

3.git status 查看文件状态

4.git add . 添加所有改变文件,包括新文件

5.git commit
git commit -m "****" 提交文件
git commit -m "****" -n 跳过校验提交文件
git commit --amend 重新提交

6.git pull 拉取代码

7.git push 推送到远程库

8.替换远程仓库地址
git remote set-url origin [新的远程仓库地址]

相关文章

网友评论

      本文标题:GIT 常用命令

      本文链接:https://www.haomeiwen.com/subject/qgbrdltx.html