0

In Git pull I was getting merge conflict. So I deleted all the folders and files inside it which was giving conflict in my local workspace. After which I did :

git pull 

Now no conflict came and my local branch became sync to remote branch.

Now when I am doing

git status

Its returning hundreds of deleted files which I removed. I assumed that most of the deleted files would be replaced by the existing files in remote but I was wrong.

How can I remove the deleted files in the git status. Its because I cannot read properly the actual files which I am going to modify or delete because of this list of files.

xpioneer
  • 3,075
  • 2
  • 16
  • 18
  • 3
    Possible duplicate of [Reset local repository branch to be just like remote repository HEAD](https://stackoverflow.com/questions/1628088/reset-local-repository-branch-to-be-just-like-remote-repository-head) – Liam Mar 20 '18 at 14:11
  • When you delete a file GIT thinks you will want to send this delete to the repo. If you want to reset a local copy, deleting the files is the wrong thing to do – Liam Mar 20 '18 at 14:12

2 Answers2

0

Instead of deleting the files and folders that were causing conflicts, I suggest you create a new folder and run git clone url. This should be the same and up to date that's if you push the last update you made locally.

antzshrek
  • 9,276
  • 5
  • 26
  • 43
0

I found the solution : I used the below :

git pull

git reset --hard HEAD

all the deleted files got removed from changed files section in git status.

So the git status showed only untracked files which I removed using

rm <filename>
rm -r <directory name>

Then I was good to have a clean working directory .

Only things which are remaining are some autogenerated files from the IDE which I am using . I believe I have to use .gitignore files to ignore them.

xpioneer
  • 3,075
  • 2
  • 16
  • 18