What command is used to list all commits in the current branch that are not in the history of the specified branch?
Posted by TinaGrn
Last Updated: June 20, 2024
To list all commits in the current branch that are not in the history of a specified branch, you can use the following Git command:
git log <branch>..HEAD
Replace <branch> with the name of the branch you want to compare against. For example, if you want to see the commits in the current branch that are not in the main branch, you would use:
git log main..HEAD
This command will show you a log of commits that are present in your current branch (indicated by HEAD) but not in the specified branch (main in this case).
Related Content