我应该如何在Visual Studio中使用Git来存储工作空间而不推送它们? [英] How should I use Git with Visual Studio to store work spaces without pushing them?

查看:93
本文介绍了我应该如何在Visual Studio中使用Git来存储工作空间而不推送它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Git与Visual Studio一起使用了大约9个月,并且已经在网上搜索了如何进行此操作,但仍然没有找到解决该问题的方法。

I've used Git with Visual Studio for about 9 months, and have searched online for how to do this but still haven't found this problem addressed. Maybe I've been searching with the wrong keywords.

通过工作空间,我指的是Visual Studio中开发人员的选项卡,窗口,断点和书签的环境。用户可能在故事处理期间设置的时间。我指的不是Visual Studio Code的无项目环境,而是Visual Studio的基于项目的环境。

By "work spaces", I am referring to the developer's environment of tabs, windows, breakpoints and bookmarks within Visual Studio that a user might set during the time (s)he works on a story. I am not referring to Visual Studio Code's project-less environment, but Visual Studio's project-based environment.

场景:开发人员必须在大型区域之间来回切换项目,以应用功能和错误修复,而无法自动切换到与作品相关的工作区:与该功能/错误相关的标签,窗口,断点和书签。

Scenario: Developers have to switch back and forth between areas of a large project to apply features and bug fixes without a way to automatically switch to that work's related "work spaces": tabs, windows, breakpoints and bookmarks related to that feature/bug.

步骤:


  1. 开发人员从本地主分支副本或直接从在线主分支创建新分支。

  2. 在添加功能或应用修订的过程中,开发人员导航至适当的文件,并使用与要添加或更改的代码区域相关的文件来设置其工作空间。

  3. 一旦提交了修订并将其推向同行审阅,开发人员便进入下一个故事,像以前一样从master创建新分支。

  4. 如果有建议或问题在同行评审期间使用代码,开发人员必须停止他们正在做的任何工作(在本地提交或存储他们的工作),然后切换回该分支以解决或研究问题。

  5. 开发人员执行此操作后,打开的文件,分隔的窗口,书签或断点都不会更改为签入工作时的状态。

  6. 一旦开发人员修复/解决了问题,他们会通过弹出存储或拉入本地提交来切换到被打断的工作。

  7. 同样,没有相关的打开文件,单独的窗口,书签等。

  1. The developer creates a new branch from either a local master branch copy or directly from the online master branch.
  2. In the process of adding the feature or applying a fix, the developer navigates to the appropriate files and sets up their "work space" with files related to that area of code being added or changed.
  3. As soon as the fix is committed and pushed up to be peer-reviewed, the developer moves onto the next story, creating a new branch from master, as before.
  4. If there is a suggestion or an issue with the code during peer review, the developer must stop whatever work they're doing (either commit or stash their work locally) and switch back to that branch to address or research the issue.
  5. When the developer does so, none of the open files, the separated windows, bookmarks or breakpoints change to how it was when they checked in their work.
  6. Once the developer has fixed/addressed the issue, they switch back to the work they were interrupted from by popping the stash or pulling in their local commit.
  7. Again, none of the related open files, separate windows, bookmarks, etc. are restored.

推送.suo或.user文件没有任何意义,因为不是每个人都在同一个文件上工作代码或以相同方式查看代码(开发人员确定应在新窗口中还是仅在选项卡中看到的内容)。但是我认为在本地检查这些文件而不将其推送到服务器可能有意义。

It wouldn't make sense to push the .suo or .user files, as not everyone is working on the same code, or view code the same way (what the developer determines should be seen in a new window or just in a tab). But I was thinking it might make sense to check in these files locally and not push them to the server.

是否有简单的方法使用git?提交不推送到服务器的私有文件(例如忽略过滤器)?如果没有,是否有插件或工具可用于实现我想要的结果?

Is there an easy way to do this with git? To commit private files that don't get pushed up to the server - like an ignore filter? If not, is there a plug-in or a tool that can be used to achieve the results I'm looking for?

谢谢。

推荐答案

我尝试使用任务画布扩展。

在任务画布中切换任务会自动还原标签页和代码片段,笔记,启动项目和Git分支。保存窗口,断点和书签尚未实现。

Switching a task in Task Canvas automatically restores tabs, code fragments, notes, startup projects and the Git branch. Saving windows, breakpoints and bookmarks is not yet implemented.

这篇关于我应该如何在Visual Studio中使用Git来存储工作空间而不推送它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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