Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Git Checkout action allows you to checkout files to the working directory and switch to a different development branch. This action is a wrapper for the git command line.

From the Git Repository tab select the local repository where you want to checkout and switch branches. If you have already specified a default local repository via Tools > Options > Git, then you can enable the Use defaults option to use this repository. Otherwise,  you can override the default local repository by enabling the Override defaults option and specifying an alternative in the field provided.

Image Removed

Once the local repository has been selected , switch to the Checkout tab and enter the name of the branch that you wish to switch to within the selected repository.

Image Removed

There are two options that can be executed with this action.

For more information on the use and options for this action, refer to the git checkout command line documentation

In the Local repository field of the Checkout tab, enter the path to a local Git working folder for the local repository that you want to checkout to. 

Image Added

You can then either:

  • enter a branch name to switch to or add,
  • enter a commit or tag to checkout,
  • or enter a tree-ish (reference to commit) and optional list of files to checkout. The list of files may be entered into the Pathspec field or loaded from a pathspec file by specifying the file path in the Pathspec from file field.
    When adding files to the list, ensure each entry is placed on a new line. The asterisk can be used as a wildcard character, which saves having to manually enter every file that you want to add.

The Checkout Options tab allows you to specify some options to pass to the Git Add command line.

Image Added


Create new branch - Select -b to create a new branch and checkout out to that branch. Select -B to do the same but also reset to any existing the branch., Alternatively you can use the --orphan option create an orphaned branch based on Start Point and switch to it.

Start point - The commit at which to start a new branchQuiet - Suppress output from Git.

Force - Allow switching branches when the index or the working tree is different to the head, which will throw away local changes.

Merge - Allows to you perform a three-way merge between the current branch, working tree contents and the new branch in order to preserve modifications. This occurs when attempting to switch branches where the current branch has local modifications that differ from the branch that is being switched to.

Force - Allow switching branches when the index or the working tree is different to the head, which will throw away local changes.

Ours - For unmerged paths, check out the original working branch.

Theirs - For unmerged paths, check out the branch that you are merging into.

Detach - Rather than checking out a branch to work on it, check out a commit for inspection and discardable experiments.

Track - When creating a new branch, set up "upstream" configuration.

No track - Do not set up "upstream" configuration, even if the branch.autoSetupMerge configuration variable is true.

Recurse submodules -  Update the content of all active submodules according to the commit recorded in the superproject.


For more information on performing a checkout with adding files to git, see :the git checkout command line documentation.