How can you list the branches that have been merged into the current branch?
Posted by QuinnLw
Last Updated: June 24, 2024
To list the branches that have been merged into the current branch in Git, you can use the following command:
git branch --merged
This command will show all branches that have been fully merged into the branch you are currently on. The output will list the branches that have been merged, and the current branch will be indicated with an asterisk (*) next to it. If you want to see both local and remote branches that have been merged into the current branch, you can use:
git branch -a --merged
This will display all branches, including remote ones, that have been merged into your current branch. Keep in mind that only branches that have been fully merged will show up in this list; if you are looking for branches with unmerged changes, you'll need to use a different approach, such as git branch --no-merged.
Related Content
What command lists all remote branches?
What command lists all remote branches?
OliviaWm | Jun 15, 2024