Using gitk to view the full history of a moved file

后端 未结 4 1277
渐次进展
渐次进展 2021-02-04 00:31

After much searching, I have not found a satisfactory method that is easy to use to view the complete history of a moved file in Git and more importantly in Gitk. Using gi

4条回答
  •  天命终不由人
    2021-02-04 01:03

    A simpler function using different git log options and awk to exact the file names (and the "--" that gitk needs is included):

    # bash
    gitk_follow () {
      while (( "$#" )); do
        git log --pretty="" --name-status --follow $1;
        shift;
      done | awk '{print $NF}' | sort -u
    }
    
    # used as:
    gitk -- $(gitk_follow some_file)
    

提交回复
热议问题