Why does this git commit exist in the log, but not in the file log?

How can I investigate how this commit was removed?

The following commands do not show the history of commit in the log:

  • git log -p apps/grants/views.py
  • gitk apps/grants/views.py

But all of the following show logging:

  • git log
  • git log --follow -p apps/grants/views.py
  • git show 5034d44861fcc39fc28b069501577c8d15321b4f

UPDATE: files were not renamed to commit. Here's the output of git log --stat :

  apps / articles / views.py |  4 + -
  apps / grants / tests.py |  16 +++++++ -----
  apps / grants / views.py |  20 +++++++++ ------
  static / css / modules.css |  36 ++++++++++++++ --------------
  templates / articles / learning_landing.html |  2 + -
  templates / grants / fellow_detail.html |  10 +++++++++
  templates / modules / fellow_search_form.html |  2 + -
  7 files changed, 53 insertions (+), 37 deletions (-)
+6
source share
3 answers

It turns out that someone merged the fixation, was the culprit. Any information that was not including this was lost in this pool. And since the merge did not add or remove anything that was not found in the log run in the file.

The failure was git show 5eaa666 had only a subset of my changes.

I added fixation again by selecting cherry: git cherry-pick 5034d44

+4
source

Usually happens with a bad merge (e.g. merge conflict)

to find him

git log -U -m --simplify-merges --merges -- filename

You will see the missing code, as well as commit identifiers

+7
source

What happened after the commit? Does this file currently exist or does it exist historically?

If it has been renamed, then you can easily "find" it using git log with the --follow , as you saw.

0
source

Source: https://habr.com/ru/post/908475/


All Articles