Question

I'm trying to revert a commit made that modified a file that has since been renamed.

The file modified used to be called bin/internal/call_parser.rb, and is currently called lib/call_parser.rb, and I'm getting in my status after trying to do a revert

$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 16 commits.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   other/unrelated/file
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#   deleted by us:      bin/internal/call_parser.rb
#

As far as I can tell, the current version of lib/call_parser.rb and the then version of the file bin/internal/call_parser.br ought to be similar enough that git can detect the shared content (I've heard that git works on file content, not on file names). How can I tell git to work harder in order to detect the rename and therefore do the revert to content within lib/call_parser.rb ?

Était-ce utile?

La solution

git mv lib/call_parser.rb bin/internal/call_parser.rb
# Do the revert
git mv bin/internal/call_parser.rb lib/call_parser.rb

Probably hacky, but Worked For Me (TM).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top