Netbeans中的Git Switch与Checkout

Muq*_*ito 6 git

我还在和Git挣扎.

事情是:

我们是两个人在一个项目上工作.

我创建了一个名为relation的master的新分支.

现在我的朋友已更新主人但需要我修复一些错误.

当我在Netbeans中切换到分支时,它给了我所有"关系" - 改变并希望我提交它们.

那不是我想要的!

Netbeans网站告诉我这个[切换到分支]:

Switch to Branch
Actor: User

Action: User wants to switch to a branch (see also Checkout)

"Priority:" 1

Scenario:

User selects a versioned context and invokes 'switch branch' from the main menu
User specifies the branch and additional options - keep local changes etc.
The working tree is switched to the specified branch
Run Code Online (Sandbox Code Playgroud)

和[结账]:

查看

Actor: User

Action: User wants to checkout a specific revision/tag/branch

"Priority:" 1

Scenario:

User selects a a versioned context and invokes 'chekout' from the main menu
User specifies the revision/tag/branch to checkout
The working tree will be switched to the specified revision
Run Code Online (Sandbox Code Playgroud)

我对GIT感到头痛!

那么两个人之间的区别是什么?

我需要有人能够切换到[Master]分支,然后更新bug,然后切换回我的[Relation]分支,而不是git告诉我在[Master]上提交来自[Relation]的更改科

Von*_*onC 5

“ Swtich分支”和“结帐”之间的区别在于您可以结帐的性质:

  • “切换分支”:您仅签出一个分支
  • Checkout ”:您签出任何<tree-ish>引用(即提交,标记或树)

仍在运行时relation,您需要:

然后,使用清晰的工作树,可以切换branch

请参阅《Netbeans用户指南》中的“结帐”

注意:如果要将文件切换到已经存在的分支(例如,切换到不在分支之一顶部的提交),则可以:

  • 使用Team > Git > Branch > Switch To Branch命令
  • Switch to Selected Branch对话框中指定分支,
  • 将其作为新分支签出(可选),
  • 然后按切换。