Friday, March 9, 2018

Git could not pull because there were uncommitted changes

Recently, I could not pull from origin master on my Visual Studio 2017. Git could not pull because there were uncommitted changes. I forgot that every change in my local repo must first be committed before pull.

One easy way to commit uncommited changes and then pull was using command-line on the Visual Studio solution folder as follows.

git add -A
git commit -m "your message"
git fetch origin master
git pull origin master
git push origin master //To push to the git