Git Console for Advanced Users
The Main Window Space for Workbench includes a status bar. As of version 7.1(16), this bar includes Git Console. When you select the Git Console tab, a console displays similar to the Windows Terminal application, where you can enter Git command line tasks. The Git Console gives the DiveLine Administrator an interactive experience similar to using Git on a terminal. The Git Console implementation in Workbench includes several GNU Readline keyboard shortcuts, command history, and simple auto completion. See https://readline.kablamo.org/emacs.html.
The Git Console is limited to the following commands using the most common flags and options:
Add file contents to the index.
Flags:
-
git add --all or git add -a—Add all files to the index.
-
git add --force or git add -f—Add ignored empty folders to the index. The prerequisite for this flag is placing a .gitkeep file by running the following command: git add --force **/.gitkeep
List, create, or delete branches.
Flags:
-
git branch --delete or git branch -d—Delete a local branch.
-
git branch --list or git branch -l—List branches.
-
git branch --all or git branch -a—List both remote-tracking branches and local branches.
-
git branch --set-upstream-to <upstream> <branchname> (optional) or git branch -u <upstream> <branchname> (optional)—Set up <branchname>'s tracking information so that <upstream> is considered the upstream branch for <branchname>. If no <branchname> is specified, it defaults to the current branch.
-
git branch --unset-upstream <branchname> (optional)—Remove the upstream information for <branchname>. If no branch is specified, it defaults to the current branch.
Switch branches/tags or restore working tree files.
Flags:
-
git checkout --branch or git checkout -b—Causes a new branch to be created as if git branch were called and then checked out.
Remove untracked files from the working tree.
Flags:
-
git clean --force or git clean -f—If the Git configuration variable clean.requireForce is true, git clean will refuse to delete files or directories unless this flag is used. Git will refuse to modify untracked nested Git repositories (any directory with a .git subdirectory) unless a second force flag is given.
-
git clean -d—Normally, when no <filepath> is specified, git clean does not recurse into untracked directories to avoid removing too much. The -d flag makes it recurse into such directories as well. If any paths are specified, this flag is unnecessary.
-
git clean --dry-run or git clean -n—With this flag set, Git does not actually remove anything, instead it shows what actions would be performed by the git clean command.
Record changes to the repository.
Flags:
-
git commit --message <message> or git commit -m <message>—Use the given <message> as the commit message.
-
git commit --all or git commit -a—The command automatically stages files that have been modified and deleted. Files newer than the last time this command was run are not affected.
-
git commit --amend—Replace the tip of the current branch by creating a new commit.
Download objects and refs from another repository.
Flags:
git fetch --tags or git fetch -t—Fetch all tags from the remote.
Display more information on a specific command.
Show commit logs.
Flags:
-
git log --max-count <limit> or git log -n <limit>—Limit the number of commits to output. Default value is 15.
Fetch from and integrate with another repository or local branch.
Update remote refs along with associated objects.
Flags:
-
git push --tags or git push -t—Push all tags to the remote.
-
git push --set-upstream or git push -u—For every branch that is up to date or successfully pushed, add an upstream (tracking) reference.
Manage set of tracked repositories.
Subcommands:
-
git remote add <name>—Add the remote <name>.
-
git remote remove <name>—Remove the remote <name>.
-
git remote set-url <name> <url>—Change URLs for the remote <name>.
Reset current HEAD to the specified state.
Flags:
-
git reset --soft—Does not touch the index file or the working tree at all (but resets the HEAD to <commit>). All changed files retain the status of "changes to be committed".
-
git reset --mixed—Resets the index but not the working tree and reports what has not been updated. Changed files are preserved, but not marked for committing.
-
git reset --hard—Resets the index and working tree. Any changes to tracked files in the working tree since <commit> are discarded.
Show the working tree status.
Create, list, or delete a tag.
Flags:
-
git tag --delete or git tag -d—Delete existing tags with the given <tag-name>.
-
git tag --list or git tag -l—List tags.
Examples:
You can learn more about each command on the Git Console by entering git help to list all commands or git <command> --help for help regarding a specific command. You can use the git help command to get a list of flags and terms that enhance the usage of a given command, such as git add. For example, git add --help shows the syntax and usage of the git add command.