美文网首页
vscode git 操作

vscode git 操作

作者: sweetBoy_9126 | 来源:发表于2022-08-29 20:48 被阅读0次

    显示源代码管理

    改键

    • settings.json
    {
         "before": ["<Leader>", "g", "g"],
          "commands": ["workbench.view.scm"]
     }
    

    将当前文件添加到暂存区(等价于 git add 当前文件)

    改键

    {
        "before": ["<Leader>", "g", "s"],
        "commands": ["git.stage"]
    }
    

    查看当前文件变更

    {
        "before": ["<Leader>", "g", "d", "f"],
         "commands": ["git.openChange"]
    }
    

    提交代码

    {
         "before": ["<Leader>", "g", "c"],
         "commands": ["git.commit"]
    }
    

    然后再 输入框输入提交信息,按回车

    从暂存区里移除当前文件

    {
        "before": ["<Leader>", "g", "u"],
        "commands": ["git.unstage"]
    }
    

    从变更中移除当前文件

    {
                  "before": ["<Leader>", "g", "c", "l"],
                  "commands": ["git.clean"]
              }
    

    扩展 edamagit

    • option x + g 弹出 git 操作框

    我们修改保存文件后会同步更改状态
    对我们修改的文件我们可以使用jk移动到文件列表上然后使用 tab 显示具体的文件变更

    • s
      将文件添加到暂存区
    • u
      从暂存区移除
    • c
      回车输入提交信息 :wq
    • l
      查看提交记录

    相关文章

      网友评论

          本文标题:vscode git 操作

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