git branch

To work with Git branches, go to Tools > Git > Local Repository and select Branches.

The Git Branches view shows a list of branches, as well as the differences between your local branches and their origin. The branch you checked out is shown in bold and underlined.

{Git Branches view}

Filter entries and tags

Old entries and tags are filtered out of the list of branches by default. To include them, select (Filter Tree), and then select Include Old Entries and Include Tags.

To add a tag to a change in the change log, select Branches > Log. Select the change, and then select Add Tag for Change in the context menu.

If you checked out a specific commit, the list of branches displays a Detached HEAD entry.

For local and remote branches, double-click the branch name to view the change log.

To refresh the list of branches, select (Refresh).

Add branches

To create a new tracking or non-tracking branch, select .

{Add Branch dialog}

To check out the branch when creating it, select Checkout new branch.

To track the selected branch, select Track local branch.

Manage branches

The context menu for a branch has the following functions:

Menu ItemDescription
AddCreate new tracking and non-tracking branches.
RemoveRemove a local branch. You cannot delete remote branches.
RenameRename a local branch or a tag. You cannot rename remote branches.
CheckoutCheck out the selected branch and make it current. You can stash changes you have made to tracked files.
DiffShow the differences between the selected and the current branch.
LogShow the changes in a branch.
ResetReset the active branch to the selected branch. You can choose between a Hard, Mixed, and Soft reset. For more information, see git reset.
MergeJoin the development histories in two branches together.
RebaseCopy local commits to the updated upstream head.
Cherry PickCherry pick the top commit from the selected branch.
TrackSet the current branch to track the selected one.
PushPush the committed changes to the selected remote branch.

The context menu for a remote branch has the following additional functions. To open it, select Remote Branches or a remote repository.

Menu ItemDescription
FetchFetch all the branches and changes information from a specific remote repository, or from all remotes if applied to Remote Branches.
Manage RemotesOpen the Remotes dialog.

See also How To: Use Git and Git.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.