

Generally, I try to make sure that any feature branches get pulled into the main development branch fairly regularly. Solution 1 git log -c -S'missingtext' /path/to/file git log doesn't show a diff for merge commits by default.
#GIT BLAME DELETED LINE SERIES#
I want to present a picture of a perfect series of sequential commits in my main branch. I personally prohibit merge commits entirely in any workflow I have anything to do with, if only to make rebase happiness. To review, open the file in an editor that reveals hidden Unicode characters. With any luck, it will go all the way through and you'll have a new clean branch where that folder was never deleted in the first place. git-search-deleted-line This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. git log -stat: Includes changed files and the number of added or deleted lines from them besides the git log information. git log -oneline: Fits each commit on a single line which is useful for an overview of the project history. For example, git log -n 2 displays only 2 commits.
Now, check the file again to make sure there's nothing bad in it, and then execute it in your shell: source cherries.sh git log -nThis will mean that the script stops if there is any problem and doesn't keep going, applying all sorts of useless commits after an error. Also remove any commit reverting that one. Remove it or you won't actually fix the problem. The first line will cherry pick the deletion of "client" dir. This leaves you with a file cherries.sh that will cherry pick all the non-merge commits. I'm assuming that exactly your merge commits contain the string "Merge pull request", which is true of this one codebase I'm experimenting on - you should check the history to find a grep that exactly only matches merges!
#GIT BLAME DELETED LINE HOW TO#
How to easily check who authored removed lines What I do now is: git blame THEFILE.TXT THEREVISION. When specified one or more times, -L restricts annotation to the requested lines. Optionally, start annotating from the given revision. Now, do this one-liner: git log -reverse -oneline -grep="Merge pull request" -invert-grep fixed.feature \ Lets say I have a particular commit in git, which contains some line removals. DESCRIPTION Annotates each line in the given file with information from the revision which last modified the line. Go back to the commit ID before deleting /client and then git cherry-pick all non merge commits after that.Ĭreate a new branch fixed that ends with the last commit before "temp removed client dir" Here's a hacky solution if you're on *nux or Cygwin, but one that will work, and likely without user intervention, and you'll end up losing the merge commits. Git rebase -preserve-merges or -rebase-merges is supposed to do that, but I never really got my head around these. Commits reachable from any of the commits given on the command line form a set, and then commits reachable from any of. Git rebase -i is the logical solution, but you have a ton of merge commits in there, and this is preventing rebasing, am I right? You can think of this as a set operation. It shows the last person who modified each line of a file in a Git repository, along with the date and the commit hash of the change.
