• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Git pull with unstashed changes succeeds

Resolved: Git pull with unstashed changes succeeds

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve Git pull with unstashed changes succeeds

Question:

I have the same repo cloned on two machines, with both machines having exactly the same git version (2.34.1).
On machine 1:
As expected, in the above commands, the first pull succeeds, and the second pull fails with:
On machine 2 (an aws/ec2 instance, and using a readonly SSH key, in case these are relevant), I repeat exactly the same set of commands (and confirm with git status that Makefile is modified, yet rather than getting an error I get Already up to date.
  1. What might be the cause of the difference in behavior?
  2. How to fix it (make it fail when files are modified)?

Best Answer:

Check first if on the second machine git config pull.rebase is set to true.
If not, a pull would use git merge, which can work if Makefile is not part of the modification being pulled (and merged).
Already up to date should mean there is nothing to pull from the second machine: check the git log --decorate --oneline --graph on both machines to confirm the local repository reference the same history or not.

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

git
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: TypeScript does not recognize properties when instantiating interface array

27/03/2023

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.