You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: version-control/command-line/tutorial.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,33 @@ $ git log
62
62
63
63
> Don't forget, you can hit `q` to quit out of a log if it's too long.
64
64
65
+
By default, with no arguments, git log shows the most recent commits first.
66
+
67
+
If we want to limit the number of log entries displayed we can use a number as an option, such as -3 to show only the last three entries.
68
+
69
+
```bash
70
+
$ git log -3
71
+
```
72
+
73
+
A very useful option is the --patch or -p. This command shows the difference of each commit. This can be very helpful to see what has changed on the last commited changes.
74
+
75
+
```bash
76
+
$ git log -p
77
+
```
78
+
79
+
If we want to see a few stats for each commit we can use the --stat command.
80
+
81
+
```bash
82
+
$ git log --stat
83
+
```
84
+
85
+
With the --graph command we will be able to draw a graphical representation of the commits. It will display an ASCII graph of the branch and merge history beside the log output.
86
+
We can use this command with the --oneline command to display the commits in an alternate format in one line.
87
+
88
+
```bash
89
+
$ git log --graph --oneline
90
+
```
91
+
65
92
### Transferring files from our local project repository to an online service
66
93
67
94
Before we can add files to a remote repository, we need to have created an account with a service that is hosting that repository. If you've not done that yet, head over to our tutorial: Get set-up with [Git and GitHub](../set-up/tutorial.html).
@@ -506,4 +533,4 @@ After typing a couple of commands in the terminal to generate some history, try
506
533
Get learning JavaScript, HTML, CSS, Ruby and more on [codebar](http://tutorials.codebar.io/).
507
534
508
535
-----
509
-
This ends **Introduction to the Git command line** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know.
536
+
This ends **Introduction to the Git command line** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know.
0 commit comments