简体   繁体   English

我可以在不同的ubuntu终端或工作区中使用不同的git分支吗?

[英]Can I have different git branch in different ubuntu terminals or workspaces?

I use Ubuntu with workspaces enabled. 我使用启用了工作区的Ubuntu。 While my code compiles in a branch, I would like to do some work on another branch. 当我的代码在一个分支中编译时,我想在另一个分支上做一些工作。 But branch changes go seem to be global across terminals and workspaces. 但是分支更改似乎在终端和工作区之间是全局的。

Is it possible to set a different git branch for one terminal or workspace without affecting the other? 是否可以为一个终端或工作空间设置一个不同的git分支,而又不影响其他分支或工作空间?

Not in the same copy of the repository. 不在存储库的同一副本中。 The way git works, the current state is a function of things stored in a .git folder at the top level of your repository. git的工作方式,当前状态是存储在存储库顶层.git文件夹中的事物的函数。 It doesn't have anything to do with any individual application using git. 它与使用git的任何单个应用程序无关。 However, you can accomplish something pretty close as described in this answer . 但是,您可以按照此答案中所述完成一些非常接近的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM