(Here, the commits marked ' -' wouldn't show up with git cherry, meaning they are already present in. 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. 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/*" git tag v1.0 v2.0 You can also execute git tag with the -n option in order to have an extensive description of your tag list. If you need to include other ref namespace ( pull request, Gerrit. Conclusion List Local Git Tags In order to list Git tags, you have to use the git tag command with no arguments. Much of the information stored there is specific to each persons local repository or stores data relating to mulitple branches, making it impractical to store. 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/* git directory is more or less a container for a bunch of metadata and local repository state tracking, which is read and written by the git command. 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 |