3

I am using the Android Studio and Git is located with it. Path of Git in Android studio is as follows, C:\Users\abc\AppData\Local\GitHub\PortableGit_cf76fc1621ac41ad4fe86c420ab5ff403f1808b9\cmd\git.exe

there are some local file changes when I tried to discard the changes to this file it says unable to discard the file. Also clicking on file and say, open containing the folder it locates the file to My Documents which is not the path of the Git. It gives me an error and unable to discard the changes.

Please find the attached error screenshot

Git version is as follows: Proctional Fungramming (3.0.14.0) 8e2e75b

Swift
  • 271
  • 3
  • 13

2 Answers2

1

you can use stash option to keep your local changes and pull from git

git stash
git pull
git stash pop

if you want to completely overwrite your local changes then reset should work

git reset --hard
git pull 
Nuthan Kumar
  • 483
  • 5
  • 22
0

git format-patch HEAD~X

will dump the desired X commits to your patch file

then use git apply to use them

CodeWizard
  • 128,036
  • 21
  • 144
  • 167