I've had a couple issues at work where changes someone else made in the repository are lost when I pull. I can't figure out why their work, which was committed and pushed, is lost when I pull and then push my commits after merging. Here is my work flow:
When I do this, the work done in someone else's last commit will be gone. I've been trying to figure out why this is happening and what I could be doing wrong. After all my research, I can't figure out what is wrong with my work flow. Is there a reason, maybe in the merge, for the last commit someone else pushed getting lost? The merge after pulling is done automatically.
Use fetch instead of pull .. it will solve the problem
Here is the link which will give deeper look
http://longair.net/blog/2009/04/16/git-fetch-and-merge/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.