5

i created a new branch A to do some work from master and did some work and did a local commit.

Then i created a branch B to do some work from master and did some work and committed it. Then i merged it to master and did push to upstream on master.

now i switched back to branch A. So to get the latest changes merged which option should i use in egit? fetch from upstream or pull ?

and what is the difference?

I dont want to chose randomly as i dont want to overwrite the changes...

1 Answer 1

10

fetch from upstream does not overwrite anything in the working tree. But pull will, but it will not completely destory work, it will create a conflict to manually merge if it can not do it automatically.

I suggest if you are unsure, ensure you working tree is clean, and everything commited. Note down the current commit-id.

Now you can do what you want and if it does wrong, you just clean you tree (by deleting stuff if needed). Then ask it to checkout the commit-id you noted. Now you are back where you were.

commit-id's are (generally) always reachable. Meaning you can not loose where you were if you know the commit-id of where you were. i.e. clean tree and current commit-id.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.