1

I am working on a project which is hosted on GIT. In some directory in my repo, somebody has deleted a file say [a.txt] at path [/home/git/myProject/generic]. Now, a lot of commits have happened on files in this directoty. I want to track down the commit in which this file was removed.

What I have tried.

git log --oneline myProject/generic 

But this returns a lot of commits and its difficult to track down the exact commit.

I also tried

git log --oneline myProject/generic/a.txt 

But this returns, path does not exist error.

Suggestions ?

1 Answer 1

1

Simply add --:

git log --oneline -- myProject/generic/a.txt 
Sign up to request clarification or add additional context in comments.

3 Comments

-- Just helps log command to identify whether user has passed a commit or path. -- refers to path. Right? Its not showing any commit when I specified -- switch.
Have you tried it? I did, and it works. Add -1 if you want to see just most recent commit touching this file (supposedly one that deleted it).
I think you are right. Even though I am not able to see any commit after using this switch too. Something else has happened. But this is the right answer for the question I have asked. Thanks :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.