Chapter 2. TortoiseGit Daily Use Guide

TortoiseGit

Chapter 2. TortoiseGit Daily Use Guide

Table of Contents

2.1. Getting Started
2.1.1. Icon Overlays
2.1.2. Context Menus
2.1.3. Drag and Drop
2.1.4. Common Shortcuts
2.1.5. Authentication
2.1.5.1. SSH (URLs look like [email protected])
2.1.5.2. HTTP/HTTPS (URLs start with https:// or http://)
2.1.6. Maximizing Windows
2.2. Create Repository
2.3. Clone Repository
2.4. Checking Out A Working Tree (Switch to commit)
2.5. Committing Your Changes To The Repository
2.5.1. The Commit Dialog
2.5.2. Commit only parts of files
2.5.3. Commit Log Messages
2.5.4. Commit Progress
2.6. Getting Status Information
2.6.1. Icon Overlays
2.6.2. Status
2.6.3. Viewing Diffs
2.7. Pull and Fetch change
2.8. Push
2.8.1. Branch
2.8.2. Destination
2.8.3. Options
2.9. Sync
2.9.1. Branch
2.9.2. Destination
2.9.3. Options
2.10. Daemon
2.11. Browse All Refs
2.12. Submodules
2.13. Log Dialog
2.13.1. Invoking the Revision Log Dialog
2.13.2. Revision Log Actions
2.13.3. Getting Additional Information
2.13.4. Filtering Log Messages
2.13.5. Navigation
2.13.6. Statistical Information
2.13.6.1. Statistics Page
2.13.6.2. Commits by Author Page
2.13.6.3. Commits by date Page
2.13.7. Refreshing the View
2.14. Revision Graphs
2.14.1. Revision Graph Nodes
2.14.2. Using the Graph
2.14.3. Refreshing the View
2.15. Reference Log
2.16. The Repository Browser
2.17. Viewing Differences
2.17.1. File Differences
2.17.2. Line-end and Whitespace Options
2.17.3. Comparing Version
2.17.4. Diffing submodules using Submodule Diff Dialog
2.17.5. Diffing Images Using TortoiseGitIDiff
2.17.6. External Diff/Merge Tools
2.18. Adding New Files
2.19. Copying/Moving/Renaming Files and Folders
2.20. Ignoring Files And Directories
2.20.1. Pattern Matching in Ignore Lists
2.21. Deleting, Moving and Renaming
2.21.1. Deleting files and folders
2.21.2. Moving files and folders
2.21.3. Changing case in a filename
2.21.4. Dealing with filename case conflicts
2.21.5. Deleting Unversioned Files
2.22. Undo Changes
2.23. Cleanup
2.24. Reset
2.25. Stash Changes
2.26. Bisect
2.27. Branching/Tagging
2.27.1. Creating a Branch or Tag
2.28. Merging
2.29. Cherry picking
2.30. Rebase
2.31. Resolving Conflicts
2.31.1. Special conflict cases
2.31.1.1. Delete-modify conflicts
2.31.1.2. Submodule conflicts
2.32. Creating and Applying Patches and Pull Requests
2.32.1. Creating a Patch Serial
2.32.2. Sending patches by mail
2.32.3. Applying a single Patch File
2.32.4. Applying a Patch Serial
2.32.5. Creating a pull request
2.33. Who Changed Which Line?
2.33.1. Blame for Files
2.34. Exporting a Git Working Tree
2.35. Integration with Bug Tracking Systems / Issue Trackers
2.35.1. Adding Issue Numbers to Log Messages
2.35.1.1. Issue Number in Text Box
2.35.1.2. Issue Numbers Using Regular Expressions
2.35.1.3. Issue Tracker Provider Settings based on Hierarchical Git Configuration
2.35.2. Getting Information from the Issue Tracker
2.36. TortoiseGit's Settings
2.36.1. General Settings
2.36.1.1. Context Menu Settings
2.36.1.2. Set Extend Menu Item
2.36.1.3. TortoiseGit Dialog Settings
2.36.1.4. TortoiseGit Dialog Settings 2
2.36.1.5. TortoiseGit Dialog Settings 3
2.36.1.6. TortoiseGit Colour Settings
2.36.1.7. TortoiseGit Colour Settings 2
2.36.1.8. TortoiseGit Colour Settings 3
2.36.2. Icon Overlay Settings
2.36.2.1. Icon Set Selection
2.36.2.2. Enabled Overlay Handlers
2.36.3. Network Settings
2.36.3.1. Email settings
2.36.4. External Program Settings
2.36.4.1. Diff Viewer
2.36.4.2. Merge Tool
2.36.4.3. Diff/Merge Advanced Settings
2.36.4.4. Alternative editor
2.36.5. Saved Data Settings
2.36.6. Git
2.36.6.1. The hierarchical git configuration
2.36.6.2. Git Config
2.36.6.3. Remote
2.36.6.4. Credential
2.36.7. Client Side Hook Scripts
2.36.7.1. Issue Tracker Integration
2.36.7.2. Config
2.36.8. TortoiseGitBlame Settings
2.36.9. TortoiseGitUDiff Settings
2.36.10. Advanced Settings
2.36.11. Exporting TortoiseGit Settings
2.37. git svn dcommit
2.38. Final Step

This document describes day to day usage of the TortoiseGit client. It is not an introduction to version control systems, and not an introduction to Git. It is more like a place you may turn to when you know approximately what you want to do, but don't quite remember how to do it.

For hints where to find more information about doing version control with Git see Section 2, “Reading Guide”.

This document is also a work in progress, just as TortoiseGit and Git are. If you find any mistakes, please report them to the mailing list so we can update the documentation. Some of the screenshots in the Daily Use Guide (DUG) might not reflect the current state of the software. Please forgive us. We're working on TortoiseGit in our free time.

In order to get the most out of the Daily Use Guide:

  • You should have installed TortoiseGit already.

  • You should be familiar with version control systems.

  • You should know the basics of Git.

  • You should have set up a server and/or have access to a Git repository.

2.1. Getting Started

2.1.1. Icon Overlays

Figure 2.1. Explorer showing icon overlays

Explorer showing icon overlays

One of the most visible features of TortoiseGit is the icon overlays which appear on files in your working tree. These show you at a glance which of your files have been modified. Refer to Section 2.6.1, “Icon Overlays” to find out what the different overlays represent.

2.1.2. Context Menus

Figure 2.2. Context menu for a directory under version control

Context menu for a directory under version control


All TortoiseGit commands are invoked from the context menu of the windows explorer. Most are directly visible, when you right click on a file or folder. The commands that are available depend on whether the file or folder or its parent folder is under version control or not. You can also see the TortoiseGit menu as part of the Explorer file menu.

[Tip] Tip

Some commands which are very rarely used are only available in the extended context menu. To bring up the extended context menu, hold down the Shift key when you right-click.

In some cases you may see several TortoiseGit entries. This is not a bug!

Figure 2.3. Explorer file menu for a shortcut in a versioned folder

Explorer file menu for a shortcut in a versioned folder


This example is for an unversioned shortcut within a versioned folder, and in the Explorer file menu there are two entries for TortoiseGit. One for the shortcut itself and the second for the object the shortcut is pointing to. To help you distinguish between them, the icons have an indicator in the lower right corner to show whether the menu entry is for a file, a folder, a shortcut or for multiple selected items.

2.1.3. Drag and Drop

Figure 2.4. Right drag menu for a directory under version control

Right drag menu for a directory under version control


Other commands are available as drag handlers, when you right drag files or folders to a new location inside working trees or when you right drag a non-versioned file or folder into a directory which is under version control.

2.1.4. Common Shortcuts

Some common operations have well-known Windows shortcuts, but do not appear on buttons or in menus. If you can't work out how to do something obvious, like refreshing a view, check here.

F1

Help, of course.

F5

Refresh the current view. This is perhaps the single most useful one-key command. For example ... In Explorer this will refresh the icon overlays on your working tree. In the commit dialog it will re-scan the working tree to see what may need to be committed. In the Revision Log dialog it will contact the repository again to check for more recent changes.

Ctrl-A

Select all. This can be used if you get an error message and want to copy and paste into an email. Use Ctrl-A to select the error message and then ...

Ctrl-C

... Copy the selected text.

Ctrl-F

Search

2.1.5. Authentication

2.1.5.1. SSH (URLs look like [email protected])

TortoiseGitPlink is recommended as SSH client because it better integrates with Windows. By default TortoiseGitPlink does not store passwords, you can use the PuTTY authentication agent for caching the password (done automatically if a PuTTY key is configured for a remote). For advanced tips & tricks see Appendix F, Tips and tricks for SSH/PuTTY. Note, however, that TortoiseGitPlink does not respect ~/.ssh/config which is OpenSSH specific (see PuTTY tips & tricks or configure OpenSSH as SSH client, see next paragraph). If you also want to use TortoiseGitPlink on Git Bash, create an environment variable called GIT_SSH with the path to the PuTTY plink.exe or preferably to TortoiseGitPLink.exe. This can be done by re-executing the Git for WIndows installer (there you can choose which SSH client to use), on the command line by executing set GIT_SSH=PATH_TO_PLINK.EXE" (C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe on default installations) or configure the environment variables permanently .

It is also possible to use OpenSSH (shipped with Git for Windows, Cygwin, and Msys2). Just open TortoiseGit settings and open the Network page and enter ssh.exe as SSH client, see Section 2.36.3, “Network Settings” and this answer on StackOverflow . When OpenSSH is used, you can also make use of ~/.ssh/config (cf. this answer on StackOverflow ).

2.1.5.2. HTTP/HTTPS (URLs start with https:// or http://)

By default Git does not save/cache credentials. However, you can configure a credential helper (recommended, also see Section G.4.3, “gitcredentials(7)”) or manually use %HOME%/_netrc .

If you have set up a credential store and you want to clear some stored credentials see this answer on StackOverflow .

2.1.6. Maximizing Windows

Many of TortoiseGit's dialogs have a lot of information to display, but it is often useful to maximize only the height, or only the width, rather than maximizing to fill the screen. As a convenience, there are shortcuts for this on the Maximize button. Use the middle mouse button to maximize vertically, and right mouse to maximize horizontally.