1

I committed to my github repo form one machine, I also work on the same project on another machine. How can I update my local repo to be current to the latest version on Github?

I tried git pull origin master but I get Please commit your changes or stash them before you merge. Aborting

Thanks for any help

GTA.sprx
  • 817
  • 1
  • 8
  • 24
  • 2
    Does this answer your question? [How do I resolve git saying "Commit your changes or stash them before you can merge"?](https://stackoverflow.com/questions/15745045/how-do-i-resolve-git-saying-commit-your-changes-or-stash-them-before-you-can-me) – Jeeter Oct 30 '19 at 18:22

2 Answers2

0

Quick action!!

You can use stash command of git.

Perform the following steps.

  1. git stash
  2. git pull origin master
  3. git stash apply
Jeet Kumar
  • 555
  • 3
  • 12
0

You have made changes in the working directory which you are trying to update to the latest version that's available in the remote repo (Github).

Your working tree has to be clean for you to pull in any changes from the remote repo.

So stash your work (which will save your work but will remove it from your working directory so that you can use it later) using git stash first.

Then pull in the changes from the remote repo using git pull origin master.

Now you can reapply the stashed changes that you had made in your working directory by using git stash apply or git stash pop.