TortoiseGit Manual

Getting Status Information

While you are working on your working tree you often need to know which files you have changed/added/removed or renamed, or even which files got changed and committed by others.

Icon Overlays

Figure 2.12. Explorer showing icon overlays

Explorer showing icon overlays


Now that you have checked out a working tree you can see your files in the windows explorer with changed icons. This is one of the reasons why TortoiseGit is so popular. TortoiseGit adds a so called overlay icon to each file icon which overlaps the original file icon. Depending on the Git status of the file the overlay icon is different.

A fresh checked out working tree has a green checkmark as overlay. That means the Git status is normal.

As soon as you start editing a file, the status changes to modified and the icon overlay then changes to a red exclamation mark. That way you can easily see which files were changed since you last updated your working tree and need to be committed.

If during an update a conflict occurs then the icon changes to a yellow exclamation mark.

This tells you that this file is marked as "assume-valid". This overlay is optional.

This tells you that this file is marked as "skip-worktree". This overlay is optional.

This icon shows you that some files or folders inside the current folder have been scheduled to be deleted from version control.

The plus sign tells you that a file has been scheduled to be added to version control.

The bar sign tells you that a file or folder is ignored for version control purposes. This overlay is optional.

This icon shows files and folders which are not under version control, but have not been ignored. This overlay is optional.

In fact, you may find that not all of these icons are used on your system. This is because the number of overlays allowed by Windows is very limited and if you are also using an old version of TortoiseCVS or tools with overlay handlers such as SkyDrive, DropBox or GoogleDrive, then there are not enough overlay slots available. TortoiseGit tries to be a Good Citizen (TM) and limits its use of overlays to give other apps a chance too.

If you have problems with overlays, please see the online FAQ.

For a description of how icon overlays correspond to Git status and other technical details, read the section called “Icon Overlays”.

Explorer Properties

Figure 2.13. Explorer property page, Git tab

Explorer property page, Git tab


TortoiseGit provides a property page in Windows Explorer for files/folders under Git version control. There you can see all relevant information about the selected file/directory. Just select a file or directory and select Windows Menuproperties in the context menu (note: this is the normal properties menu entry the explorer provides, not the one in the TortoiseGit submenu!).

Status

Figure 2.14. Check for Modifications

Check for Modifications


It's often very useful to know which files you have changed and also which files got changed and committed by others. That's where the command TortoiseGitCheck For Modifications... comes in handy. This dialog will show you every file that has changed in any way in your working tree, as well as any unversioned files you may have.

The dialog uses color coding to highlight the status.

Blue

Locally modified items.

Purple

Added items. Items which have been added with history have a + sign in the Text status column, and a tooltip shows where the item was copied from.

Dark red

Deleted or missing items.

Green

Items modified locally and in the repository. The changes will be merged on update. These may produce conflicts on update.

Bright red

Items modified locally and deleted in repository, or modified in repository and deleted locally. These will produce conflicts on update.

Black

Unchanged and unversioned items.

This is the default color scheme, but you can customise those colors using the settings dialog. Read the section called “TortoiseGit color Settings” for more information.

From the context menu of the dialog you can show a diff of the changes. Check the local changes you made using Context MenuCompare with Base. Check the changes in the repository made by others using Context MenuShow Differences as Unified Diff.

You can also revert changes in individual files. If you have deleted a file accidentally, it will show up as Missing and you can use Revert to recover it.

Unversioned and ignored files can be sent to the recycle bin from here using Context MenuDelete. If you want to delete files permanently (bypassing the recycle bin) hold the Shift key while clicking on Delete.

If you want to examine a file in detail, you can drag it from here into another application such as a text editor or IDE.

The columns are customizable. If you right click on any column header you will see a context menu allowing you to select which columns are displayed. You can also change column width by using the drag handle which appears when you move the mouse over a column boundary. These customizations are preserved, so you will see the same headings next time.

If you are working on several unrelated tasks at once, you can also group files together into changelists. Read the section called “Change Lists” for more information.

At the bottom of the dialog you have several options to select which entries to show (such as ignored or untracked/unversioned files). It is also possible to view all files which were marked as "Assume valid" or "Skip worktree" here (using Show ignore local changes flagged files). Resetting those flags (it's also possible to edit this flag using file properties in explorer on the Git tab).

Save unified diff: Generates an unified patch containing the uncommitted changes and opens it with the configured diff viewer. If you want to pass your changes to other people, consider the section called “Creating and Applying Patches and Pull Requests”.

Stash: Is a drop-down menu for quick access to Git stash (cf. the section called “Stash Changes”). This feature allows you to put aside uncommitted changes in order to work on an unrelated issue and get the changes back afterwards easily.

Commit: Opens the commit dialog (cf. the section called “Committing Your Changes To The Repository”) with the very same folder/files the current dialog was opened on. If you want to pre-populate the commit dialog with only a subset of files, select the files and choose Commit... in the context menu.

Viewing Diffs

Often you want to look inside your files, to have a look at what you've changed. You can accomplish this by selecting a file which has changed, and selecting Diff from TortoiseGit's context menu. This starts the external diff-viewer, which will then compare the current file with the pristine copy (BASE revision), which was stored after the last checkout or update.

Tip

Even when not inside a working tree or when you have multiple versions of the file lying around, you can still display diffs:

Select the two files you want to compare in explorer (e.g. using Ctrl and the mouse) and choose Diff from TortoiseGit's context menu. The file clicked last (the one with the focus, i.e. the dotted rectangle) will be regarded as the later one.