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: book/02-git-basics/sections/recording-changes.asc
+36-40Lines changed: 36 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,7 +237,7 @@ doc/**/*.txt
237
237
238
238
[TIP]
239
239
====
240
-
GitHub maintains a fairly comprehensive list of good `.gitignore` file examples for dozens or projects and languages at https://github.com/github/gitignore[] if you want a starting point for your project.
240
+
GitHub maintains a fairly comprehensive list of good `.gitignore` file examples for dozens of projects and languages at https://github.com/github/gitignore[] if you want a starting point for your project.
241
241
====
242
242
243
243
[[_git_diff_staged]]
@@ -273,20 +273,19 @@ To see what you've changed but not yet staged, type `git diff` with no other arg
273
273
----
274
274
$ git diff
275
275
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
276
-
index 3cb747f..e445e28 100644
276
+
index 8ebb991..643e24f 100644
277
277
--- a/CONTRIBUTING.md
278
278
+++ b/CONTRIBUTING.md
279
-
@@ -36,6 +36,10 @@ def main
280
-
@commit.parents[0].parents[0].parents[0]
281
-
end
282
-
283
-
+ run_code(x, 'commits 1') do
284
-
+ git.commits.size
285
-
+ end
286
-
+
287
-
run_code(x, 'commits 2') do
288
-
log = git.commits('master', 15)
289
-
log.size
279
+
@@ -65,7 +65,8 @@ branch directly, things can get messy.
280
+
Please include a nice description of your changes when you submit your PR;
281
+
if we have to read the whole diff to figure out why you're contributing
282
+
in the first place, you're less likely to get feedback and have your change
283
+
-merged in.
284
+
+merged in. Also, split your changes into comprehensive chunks if you patch is
285
+
+longer than a dozen lines.
286
+
287
+
If you are starting to work on a particular area, feel free to submit a PR
288
+
that highlights your work in progress (and note in the PR title that it's
290
289
----
291
290
292
291
That command compares what is in your working directory with what is in your staging area.
@@ -303,11 +302,8 @@ new file mode 100644
303
302
index 0000000..03902a1
304
303
--- /dev/null
305
304
+++ b/README
306
-
@@ -0,0 +1,4 @@
305
+
@@ -0,0 +1 @@
307
306
+My Project
308
-
+
309
-
+ This is my project and it is amazing.
310
-
+
311
307
----
312
308
313
309
It's important to note that `git diff` by itself doesn't show all changes made since your last commit – only changes that are still unstaged.
@@ -318,7 +314,7 @@ For another example, if you stage the `CONTRIBUTING.md` file and then edit it, y
318
314
[source,console]
319
315
----
320
316
$ git add CONTRIBUTING.md
321
-
$ echo '# test line' >> CONTRIBUTING.md
317
+
$ echo 'test line' >> CONTRIBUTING.md
322
318
$ git status
323
319
On branch master
324
320
Changes to be committed:
@@ -339,13 +335,13 @@ Now you can use `git diff` to see what is still unstaged
339
335
----
340
336
$ git diff
341
337
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
342
-
index e445e28..86b2f7c 100644
338
+
index 643e24f..87f08c8 100644
343
339
--- a/CONTRIBUTING.md
344
340
+++ b/CONTRIBUTING.md
345
-
@@ -127,3 +127,4 @@ end
346
-
main()
347
-
348
-
##pp Grit::GitRuby.cache_client.stats
341
+
@@ -119,3 +119,4 @@ at the
342
+
## Starter Projects
343
+
344
+
See our [projects list](https://github.com/libgit2/libgit2/blob/development/PROJECTS.md).
349
345
+# test line
350
346
----
351
347
@@ -355,20 +351,19 @@ and `git diff --cached` to see what you've staged so far:
355
351
----
356
352
$ git diff --cached
357
353
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
358
-
index 3cb747f..e445e28 100644
354
+
index 8ebb991..643e24f 100644
359
355
--- a/CONTRIBUTING.md
360
356
+++ b/CONTRIBUTING.md
361
-
@@ -36,6 +36,10 @@ def main
362
-
@commit.parents[0].parents[0].parents[0]
363
-
end
364
-
365
-
+ run_code(x, 'commits 1') do
366
-
+ git.commits.size
367
-
+ end
368
-
+
369
-
run_code(x, 'commits 2') do
370
-
log = git.commits('master', 15)
371
-
log.size
357
+
@@ -65,7 +65,8 @@ branch directly, things can get messy.
358
+
Please include a nice description of your changes when you submit your PR;
359
+
if we have to read the whole diff to figure out why you're contributing
360
+
in the first place, you're less likely to get feedback and have your change
361
+
-merged in.
362
+
+merged in. Also, split your changes into comprehensive chunks if you patch is
363
+
+longer than a dozen lines.
364
+
365
+
If you are starting to work on a particular area, feel free to submit a PR
366
+
that highlights your work in progress (and note in the PR title that it's
372
367
----
373
368
374
369
[[_git_difftool]]
@@ -472,14 +467,15 @@ If you simply remove the file from your working directory, it shows up under the
472
467
473
468
[source,console]
474
469
----
475
-
$ rm grit.gemspec
470
+
$ rm PROJECTS.md
476
471
$ git status
477
472
On branch master
473
+
Your branch is up-to-date with 'origin/master'.
478
474
Changes not staged for commit:
479
475
(use "git add/rm <file>..." to update what will be committed)
480
476
(use "git checkout -- <file>..." to discard changes in working directory)
481
477
482
-
deleted: grit.gemspec
478
+
deleted: PROJECTS.md
483
479
484
480
no changes added to commit (use "git add" and/or "git commit -a")
485
481
----
@@ -488,14 +484,14 @@ Then, if you run `git rm`, it stages the file's removal:
488
484
489
485
[source,console]
490
486
----
491
-
$ git rm grit.gemspec
492
-
rm 'grit.gemspec'
487
+
$ git rm PROJECTS.md
488
+
rm 'PROJECTS.md'
493
489
$ git status
494
490
On branch master
495
491
Changes to be committed:
496
492
(use "git reset HEAD <file>..." to unstage)
497
493
498
-
deleted: grit.gemspec
494
+
deleted: PROJECTS.md
499
495
----
500
496
501
497
The next time you commit, the file will be gone and no longer tracked.
0 commit comments