i just want to update my local files with git. but every time i try to pull i get and error saying that i need to commit certain file first. what is the way to update local file without using commit??
here is the error message
$ git pull Enter passphrase for key '/c/Users/me/.ssh/id_rsa': Updating 4dsdSe6e..70fb5b6 error: Your local changes to the following files would be overwritten by merge: grails-app/conf/DataSource.groovy Please, commit your changes or stash them before you can merge. Aborting
If you don't want to commit, you'll need to stash your changes. This sounds like what you're looking for:
git stash save "Changes I don't want to commit yet"
git pull
git stash pop
The first line stashes your changes onto a stack and reverts your code to the last commit. From there, you can pull like normal. Once you've pulled, pop the changes in your stash back onto your code. This let's you do a pull without committing your code. You can learn more about stashing here.
Hope that helped!
You are trying to pull some files that will delete your changes. First, commit your changes with:
git commit -a -m "I have changed XXXX"
then pull others:
git pull
If no problems to solve, you can push your changes:
git push
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With