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
The `git add` command adds content from the working directory into the staging area (or ``index'') for the next commit.
185
+
The `git add` command adds content from the working directory into the staging area (or βindexβ) for the next commit.
186
186
When the `git commit` command is run, by default it only looks at this staging area, so `git add` is used to craft what exactly you would like your next commit snapshot to look like.
@@ -1069,9 +1069,9 @@ If you're administering a Git repository or need to fix something in a big way,
1069
1069
==== git gc
1070
1070
1071
1071
//////////////////////////
1072
-
The `git gc` command runs ``garbage collection'' on your repository, removing unnecessary files in your database and packing up the remaining files into a more efficient format.
1072
+
The `git gc` command runs βgarbage collectionβ on your repository, removing unnecessary files in your database and packing up the remaining files into a more efficient format.
Copy file name to clipboardExpand all lines: book/01-introduction/sections/about-version-control.asc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@
5
5
6
6
(((version control)))
7
7
//////////////////////////
8
-
What is ``version control'', and why should you care?
8
+
What is βversion controlβ, and why should you care?
9
9
Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
10
10
For the examples in this book, you will use software source code as the files being version controlled, though in reality you can do this with nearly any type of file on a computer.
In addition, if you don't need the full-blown manpage help, but just need a quick refresher on the available options for a Git command, you can ask for the more concise ``help'' output with the `-h` or `--help` options, as in:
38
+
In addition, if you don't need the full-blown manpage help, but just need a quick refresher on the available options for a Git command, you can ask for the more concise βhelpβ output with the `-h` or `--help` options, as in:
That creates a directory named `libgit2`, initializes a `.git` directory inside it, pulls down all the data for that repository, and checks out a working copy of the latest version.
138
138
If you go into the new `libgit2` directory that was just created, you'll see the project files in there, ready to be worked on or used.
@@ -96,12 +96,12 @@ nothing added to commit but untracked files present (use "git add" to track)
96
96
----
97
97
98
98
//////////////////////////
99
-
You can see that your new `README` file is untracked, because it's under the ``Untracked files'' heading in your status output.
99
+
You can see that your new `README` file is untracked, because it's under the βUntracked filesβ heading in your status output.
100
100
Untracked basically means that Git sees a file you didn't have in the previous snapshot (commit); Git won't start including it in your commit snapshots until you explicitly tell it to do so.
101
101
It does this so you don't accidentally begin including generated binary files or other files that you did not mean to include.
102
102
You do want to start including `README`, so let's start tracking the file.
You can tell that it's staged because it's under the ``Changes to be committed'' heading.
145
+
You can tell that it's staged because it's under the βChanges to be committedβ heading.
146
146
If you commit at this point, the version of the file at the time you ran `git add` is what will be in the historical snapshot.
147
147
You may recall that when you ran `git init` earlier, you then ran `git add <files>` -- that was to begin tracking files in your directory.(((git commands, init)))(((git commands, add)))
148
148
The `git add` command takes a path name for either a file or a directory; if it's a directory, the command adds all the files in that directory recursively.
149
149
//////////////////////////
150
-
``Changes to be committed'' μ λ€μ΄ μλ νμΌμ Staged μνλΌλ κ²μ μλ―Ένλ€.
150
+
βChanges to be committedβ μ λ€μ΄ μλ νμΌμ Staged μνλΌλ κ²μ μλ―Ένλ€.
@@ -183,13 +183,13 @@ Changes not staged for commit:
183
183
----
184
184
185
185
//////////////////////////
186
-
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.
186
+
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.
187
187
To stage it, you run the `git add` command.
188
188
`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.
189
-
It may be helpful to think of it more as ``add precisely this content to the next commit'' rather than ``add this file to the project''.(((git commands, add)))
189
+
It may be helpful to think of it more as βadd precisely this content to the next commitβ rather than βadd this file to the projectβ.(((git commands, add)))
190
190
Let's run `git add` now to stage the `CONTRIBUTING.md` file, and then run `git status` again:
The first line tells Git to ignore any files ending in ``.o'' or ``.a'' -- object and archive files that may be the product of building your code.
331
+
The first line tells Git to ignore any files ending in β.oβ or β.aβ -- object and archive files that may be the product of building your code.
332
332
The second line tells Git to ignore all files whose names end with a tilde (`~`), which is used by many text editors such as Emacs to mark temporary files.
333
333
You may also include a log, tmp, or pid directory; automatically generated documentation; and so on.
334
334
Setting up a `.gitignore` file for your new repository before you get going is generally a good idea so you don't accidentally commit files that you really don't want in your Git repository.
If you simply remove the file from your working directory, it shows up under the ``Changes not staged for commit'' (that is, _unstaged_) area of your `git status` output:
783
+
If you simply remove the file from your working directory, it shows up under the βChanges not staged for commitβ (that is, _unstaged_) area of your `git status` output:
0 commit comments