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
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ The `git add` command takes a path name for either a file or a directory; if it'
86
86
==== Staging Modified Files
87
87
88
88
Let's change a file that was already tracked.
89
-
If you change a previously tracked file called ``CONTRIBUTING.md'' and then run your `git status` command again, you get something that looks like this:
89
+
If you change a previously tracked file called `CONTRIBUTING.md` and then run your `git status` command again, you get something that looks like this:
90
90
91
91
[source,console]
92
92
----
@@ -105,11 +105,11 @@ Changes not staged for commit:
105
105
106
106
----
107
107
108
-
The ``CONTRIBUTING.md'' file appears under a section named ``Changes not staged for commit'' – which means that a file that is tracked has been modified in the working directory but not yet staged.
108
+
The `CONTRIBUTING.md` file appears under a section named ``Changes not staged for commit'' – which means that a file that is tracked has been modified in the working directory but not yet staged.
109
109
To stage it, you run the `git add` command.
110
110
`git add` is a multipurpose command – you use it to begin tracking new files, to stage files, and to do other things like marking merge-conflicted files as resolved.
111
111
It may be helpful to think of it more as ``add this content to the next commit'' rather than ``add this file to the project''.(((git commands, add)))
112
-
Let's run `git add` now to stage the ``CONTRIBUTING.md'' file, and then run `git status` again:
112
+
Let's run `git add` now to stage the `CONTRIBUTING.md` file, and then run `git status` again:
113
113
114
114
[source,console]
115
115
----
@@ -465,7 +465,7 @@ $ git commit -a -m 'added new benchmarks'
465
465
1 file changed, 5 insertions(+), 0 deletions(-)
466
466
----
467
467
468
-
Notice how you don't have to run `git add` on the ``CONTRIBUTING.md'' file in this case before you commit.
468
+
Notice how you don't have to run `git add` on the `CONTRIBUTING.md` file in this case before you commit.
Copy file name to clipboardExpand all lines: book/10-git-internals/sections/objects.asc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,8 +149,8 @@ image::images/data-model-1.png[Simple version of the Git data model.]
149
149
You can fairly easily create your own tree.
150
150
Git normally creates a tree by taking the state of your staging area or index and writing a series of tree objects from it.
151
151
So, to create a tree object, you first have to set up an index by staging some files.
152
-
To create an index with a single entry – the first version of your test.txt file – you can use the plumbing command `update-index`.
153
-
You use this command to artificially add the earlier version of the test.txt file to a new staging area.
152
+
To create an index with a single entry – the first version of your `test.txt` file – you can use the plumbing command `update-index`.
153
+
You use this command to artificially add the earlier version of the `test.txt` file to a new staging area.
154
154
You must pass it the `--add` option because the file doesn't yet exist in your staging area (you don't even have a staging area set up yet) and `--cacheinfo` because the file you're adding isn't in your directory but is in your database.
If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the test.txt file.
223
+
If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the `test.txt` file.
224
224
You can think of the data that Git contains for these structures as being like this:
0 commit comments