Louis
前端开发工程师
湘ICP备18005867号-1

Git常用指令合集

发布:2023年05月21日 23:08:25
分类:Git
更新:2023年05月22日 18:16:38
字数:undefined字
  • 配置用户名
git config --global user.name <your name>
  • 配置用户邮箱地址
git config --global user.email <your email>
  • 切换到某分支
# 切换到本地分支
git checkout -d <branchName> 
# 切换到远程分支
git checkout <branchName>
# 基于远程分支拉取代码到本地的新分支
git checkout -b <branchName> origin/<branchName>
  • 取消本地修改
git reset <fileName>
  • 暂存本地修改
git add.
  • 将本地代码提交到远端仓库
# 将暂存区的代码提交到远端仓库
git commit -m <description>
# 跳过暂存区,将本地修改的所有代码提交到远端仓库
git commit -a -m <description>
  • 查看本地的Git状态
git status
上一篇:
没有了
下一篇:
没有了