Reputation: 1399
I'm still struggling with Git.
The thing is:
We're a two persons working on a project.
I created a new branch out of master called relation.
Now my friend have updated master but needs me to fix some bugs on it.
When I do a switch to branch in Netbeans it gives me all my "relation"-changes and wants me to commit them.
That's not what I'm looking for!
Netbeans site tells me this [Switch to branch]:
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
and [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
I'm getting a headache from GIT!
So what's the difference between theese two?
I need to someone be able to switch to the [Master] branch and then update the bugs, and then switch back to my [Relation] branch without git telling me to commit changes from [Relation] when I'm on the [Master] branch
Upvotes: 7
Views: 12226
Reputation: 1327004
The difference between "Swtich Branch" and "Checkout" is the nature of what you can checkout:
<tree-ish>
reference (i.e. commit, tag or tree)While still on relation
, you need to:
Then, with a clear working tree, you can switch branch.
See the 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.
Upvotes: 7