1

click to see the image

I've been working on the project. In the middle of the day, this file had unknowingly popped up on the "Staged files". I couldn't do anything to it.

I checked in the explorer. This file was still there. It's a regular text file.

Does anybody have any ideas?

Here are what I've tried to solve the problem:

  • reset the branch - hard
  • stash the file
  • use terminal
  • checkout another branch and come back to the current branch

None of these worked.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • The readme file is there in order to describe what your project is about. If you don't want it, you can unstage (`remove`) it. – dan1st Oct 15 '20 at 05:05
  • I didn't do anything to it though. I also want to keep it that way. The program just popped it in the panel. If i commit the deletion and push, I will affect my teammate. – Alec Kingard Oct 15 '20 at 05:15
  • 1
    Does this answer your question? [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) – dan1st Oct 15 '20 at 07:52
  • Please don't put "Solved" in question and answer. We don't that here in Stack Overflow. Instead, click on the checkmark next to the answer. That will mark the answer as the one that solved the problem (will also show in green box in the question list). See [Can I answer my own question?](https://stackoverflow.com/help/self-answer) – Gino Mempin Oct 15 '20 at 12:14

2 Answers2

0

This is the solution.

I use git reset on the terminal.

git fetch origin
git reset --hard origin/develop

then switched to another branch, then came back to develop again.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • Please don't put "Solved" in question and answer. We don't that here in Stack Overflow. Instead, click on the checkmark next to the answer. That will mark the answer as the one that solved the problem (will also show in green box in the question list). See [Can I answer my own question?](https://stackoverflow.com/help/self-answer) – Gino Mempin Oct 15 '20 at 12:14
0

Faced same issue. I deleted the project in my local and I have cloned the same project freshly. it works.

Arun
  • 9
  • 1