You can tell it is unchanged because when I run git status, git reports no changes. Here, I undid the change on line 2 of the file. (Here, the commits marked ' -' wouldn't show up with git cherry, meaning they are already present in. This is true even if we rename a file to which we have made no other changes whatsoever. which branches have cherry-picked that commit) that's git cherry:īecause git cherry compares the changeset rather than the commit id (sha1), you can use git cherry to find out if a commit you made locally has been applied under a different commit id.įor example, this will happen if you’re feeding patches via email rather than pushing or pulling commits directly. If you want to know which branches contain an "equivalent" commit (i.e. MatrixFrog comments that it only shows which branches contain that exact commit. (as MichielB comments below) git branch -a -contains Note: if the commit is on a remote tracking branch, add the -a option. By default, the file at path will be copied from its current state in the repos default branch. Perhaps you’ve got a commit SHA from a patch you thought you had applied, or you just want to check if commit for your favorite open source project that reduces memory usage by 75% is in yet. The -contains tag will figure out if a certain commit has been brought in yet into your branch. ), you need to add that new refspec, and fetch again: git config -add "+refs/pull/*/head:refs/remotes/origin/pr/*" If you need to include other ref namespace ( pull request, Gerrit. When you search from the top of directory listings, results are included from this location in the file hierarchy including files inside sub-directories. Lists remote tracking branches as well (as mentioned in user3941992's answer below) that is "local branches that have a direct relationship to a remote branch".Īs noted by Carl Walsh, this applies only to the default refspec fetch = +refs/heads/*:refs/remotes/origin/* Only list branches which contain the specified commit (HEAD if not specified). From the git-branch manual page: git branch -contains
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |