Skip to content

Commit 225e08e

Browse files
committed
GUIs part 1
1 parent 7e56c1a commit 225e08e

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

en/book/10-git-in-other-environments/chapter10.asc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,58 @@
11
== Git in Other Environments
22

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+
38
=== Graphical Interfaces
49

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+
519
==== gitk & git-gui
620

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+
756
==== GitHub for Windows/Mac
857

958
==== Other GUIs

en/book/images/git-gui.png

33.2 KB
Loading

en/book/images/gitk.png

62.2 KB
Loading

0 commit comments

Comments
 (0)