Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

egit pull and fetch from upstream

Tags:

eclipse

egit

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...

like image 261
Vik Avatar asked Sep 22 '12 19:09

Vik


1 Answers

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.

like image 179
Darryl Miles Avatar answered Oct 10 '22 05:10

Darryl Miles