|
1 | 1 | == Git in Other Environments
|
2 | 2 |
|
| 3 | +If you've read this far, you've learned a lot about how to use Git at the command line. |
| 4 | +You can work with local files, connect your repository to others over a network, and work effectively with others. |
| 5 | +But the story doesn't end there; Git is usually used as part of a larger ecosystem, and the terminal isn't always the best way to work with Git. |
| 6 | +Now we'll take a look at some of the other kinds of environments where Git can be useful. |
| 7 | + |
3 | 8 | === Graphical Interfaces
|
4 | 9 |
|
| 10 | +Git's native environment is in the terminal. |
| 11 | +New features show up there first, and only at the command line is the full power of Git completely at your disposal. |
| 12 | +But plain text isn't the best choice for all tasks; sometimes a visual representation is what you need, and some users are much more comfortable with a point-and-click interface. |
| 13 | + |
| 14 | +Remember that different interfaces are tailored for different workflows. |
| 15 | +Some clients only expose only a carefully curated subset of Git functionality, in order to support a specific way of using Git that the author considers effective. |
| 16 | +When viewed in this light, none of these tools is ``better'' than any of the others, they're simply more fit for their intended purpose. |
| 17 | +Also note that there's nothing these graphical clients can do that the command-line client can't. |
| 18 | + |
5 | 19 | ==== gitk & git-gui
|
6 | 20 |
|
| 21 | +When you install Git, you also get its visual tools, `gitk` and `git-gui`. |
| 22 | + |
| 23 | +`gitk` is a graphical shell over `git log`, and it acts primarily as a history viewer. |
| 24 | +It is easiest to invoke from the command-line; `cd` into a Git repository, and type: |
| 25 | + |
| 26 | +----- |
| 27 | +gitk [git log options] |
| 28 | +----- |
| 29 | + |
| 30 | +Gitk accepts many command-line options, most of which are passed through to the underlying `git log` action. |
| 31 | +Probably one of the most useful is the `--all` flag, which tells gitk to show commits reachable from _any_ ref, not just HEAD. |
| 32 | +Gitk's interface looks like <<gitk>>. |
| 33 | + |
| 34 | +[[gitk]] |
| 35 | +.The `gitk` history viewer. |
| 36 | +image::images/gitk.png[The `gitk` history viewer.] |
| 37 | + |
| 38 | +On the top is something that looks a bit like the output of `git log --graph`; each dot represents a commit, and the graph is decorated with refs. |
| 39 | +The yellow dot represents HEAD, and the red dot represents changes that are yet to become a commit. |
| 40 | +At the bottom is a view of the selected commit; the comments and patch on the left, and a summary view on the right. |
| 41 | +In between is a collection of controls used for searching history. |
| 42 | + |
| 43 | +`git-gui`, on the other hand, is primarily a tool for crafting commits. |
| 44 | +It, too, is easiest to invoke from the command line: |
| 45 | + |
| 46 | +----- |
| 47 | +git gui |
| 48 | +----- |
| 49 | + |
| 50 | +And it looks something like <<git-gui>>. |
| 51 | + |
| 52 | +[[git-gui]] |
| 53 | +.The `git-gui` commit tool. |
| 54 | +image::images/git-gui.png[The `git-gui` commit tool.] |
| 55 | + |
7 | 56 | ==== GitHub for Windows/Mac
|
8 | 57 |
|
9 | 58 | ==== Other GUIs
|
|
0 commit comments