Visual Studio Code 中的 Git 变基 [英] Git rebase in Visual Studio Code

查看:77
本文介绍了Visual Studio Code 中的 Git 变基的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的情况:我有一个生产分支、一个开发分支和功能分支.当我在开发一个功能时,我必须在 dev 分支上做一个修补程序.现在我要重新设置我目前正在处理的功能分支,以避免未来的合并冲突.当我过去使用 JetBrain 的 IDE 时,我会做一个 git rebase,它可以解决问题.我在 VSCode 中唯一喜欢的命令是 Git: Sync(rebase) 但这不会做任何事情并且不会变基.我得到的只是这条消息:

Here is my situation: I have a production branch, a dev branch and branches for features. While I was working on a feature I has to do a hotfix on the dev branch. Now I to rebase the feature branch I am currently working on to avoid future merging conflicts. When I used to use IDEs from JetBrain I would do a git rebase and it would do the trick. The only command I fond in VSCode is Git: Sync(rebase) but this does not do anything and does not rebase. All i get is this message:

This action will push and pull commit to and from 'origin/Current_feature'

有人有这方面的经验吗?

Anyone have experience with this?

推荐答案

我认为 Visual Studio Code 没有内置 Git 变基功能.如果您想在 Visual Studio Code 中使用 git 命令行工具或 Git GUI,您可以安装 GitLens VS Code 的扩展.

I don't think Visual Studio Code has Git rebase functionality built-in. If you want to do your rebasing in Visual Studio Code instead with the git command-line tool or with a Git GUI, you can install the GitLens extension for VS Code.

GitLens 的 README 表明 GitLens 支持 rebase.它说在查看分支时,每个分支的上下文菜单包含以下命令:

GitLens’s README indicates that GitLens supports rebasing. It says that when viewing branches, the context menu for each branch includes these commands:

  • Rebase(交互式)分支(通过终端)
  • Rebase(交互式)分支到远程(通过终端)

查看一个分支中的提交时,每个提交的上下文菜单都包含以下命令:

And when viewing the commits in one branch, the context menu for each commit includes this command:

  • Rebase to Commit(通过终端)(如果可用)
  • Rebase to Commit (via Terminal) (when available)

这篇关于Visual Studio Code 中的 Git 变基的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆