I have a problem when working on too many branches, it takes a lot of time to find which is the current branch I am working on right now. Is there a way to list the current branch on top of the list that shows up when using the git branch
command?
Your answer You can run the git branch command in your CMD. It should show all the local branches of your repo. The starred branch is your current branch.
Command #1: git branch -r This Git command will show you remote branches.
To view your remote branches, simply pass the -r flag to the git branch command. You can inspect remote branches with the usual git checkout and git log commands. If you approve the changes a remote branch contains, you can merge it into a local branch with a normal git merge .
The git branch command lets you create, list, rename, and delete branches. It doesn't let you switch between branches or put a forked history back together again. For this reason, git branch is tightly integrated with the git checkout and git merge commands.
If you just want the checked-out branch, use git branch --show-current
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With