See with tig which git commits touch a file or files or folders
tig path_to_file_or_files_or_path_with_wildcard
Related cards:
Git: What to do when "git log" does not show commits that touch a file
Let's say you have commits that change a file (and looking at the commit details show you the changes, etc). Now, when you do a git log
you see them, but when you say git log that.file
these commits don't show up? This is for you.
The reason ...
Git: Retrieve a file from a different branch or commit
To access files from another branch or past commit without doing a complete checkout, you can either use
git show branch:file
git show commit:file
to display, or check out the file into your working directory with
git checkout bra...
Git: Show commits that have touched specific text in a file
If you want to find the commits that touched a specific text in a file, use
git log -S 'text in the code' -- path/to/file
If you use tig you may run a similar command to get a navigatable list of affected files:
tig -S'text ...
Git diff a file with another revision (or branch)
git diff commit_hash -- path/to/file
Provide any commit hashes or branch names like "master
" for commit_hash
.
How to ignore new files or changed files in git
How to ignore new files
Globally
Add the path(s) to your file(s) which you would like to ignore to your .gitignore
file (and commit them). These file entries will also apply to others checking out the repo.
Loc...
Git: See all unpushed commits or commits that are not in another branch
If you need to find out which of your local commits are not on the remote server do this:
git cherry -v
The -v
option prints out the commit messages. Without it you will see only the SHA1 codes.
You may also compare against another (upstr...
Shell script to generate a Git commit with Pivotal Tracker story ID and title
We usually generate our commit messages from Pivotal Tracker IDs and titles, like
[#15775609] Index view for conflicts
The geordi command commit
automates this. (See: [Pretty Commit messages via geord...
Squashing several Git commits into a single commit
This note shows how to merge an ugly feature branch with multiple dirty WIP commits back into the master as one pretty commit.
Squashing commits with git rebase
What we are describing here will destroy commi...
How to not leave trailing whitespace (using your editor or Git)
There is no reason to leave trailing whitespace characters in your project's files, so don't add any.
A git diff --check
will tell you if there are any and you should not commit when you see them. So go ahead and switch your editor/IDE to autom...
Files open with an error "the location is not a folder" after installing XFCE
When using gnome-open
(i.e. double-clicking a file, telling to browser to open a download, etc.) on Ubuntu you may get this error:
The location is not a folder.
It's due to the exo-utils
package which [does not play nice with gnome-open
]...