gpt4 book ai didi

Git Switch 与 Netbeans 中的 Checkout

转载 作者:太空狗 更新时间:2023-10-29 13:23:29 25 4
gpt4 key购买 nike

我还在为 Git 苦苦挣扎。

事情是:

我们是两个人在做一个项目。

我在 master 之外创建了一个名为 relation 的新分支。

现在我的 friend 已经更新了 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

和[ checkout ]:

checkout

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

GIT 让我头疼!

那么这两者有什么区别呢?

当我在[硕士]分支

最佳答案

“Swtich Branch”和“Checkout”之间的区别在于您可以 checkout 的内容的性质:

  • “切换分支”:你只 checkout 一个分支
  • "Checkout ":你 checkout 任何<tree-ish>引用(即提交、标记或树)

虽然仍在 relation ,您需要:

  • 或者Add然后 commit您当前的修改
  • stash您当前未提交的修改

然后,有了清晰的工作树,您可以 switch branch .

参见 Netbeans User Guide on Checkout

Note: If you want to switch your files to a branch that already exists (e.g., to a commit that is not at the top of one of your branches), you can:

  • use the Team > Git > Branch > Switch To Branch command,
  • specify the branch in the Switch to Selected Branch dialog box,
  • check it out as a new branch (optionally),
  • and press Switch.

关于Git Switch 与 Netbeans 中的 Checkout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15808959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com