Skip to content

Commit 094016c

Browse files
committed
terminato il ripristino nomi file e relativi riferimenti incrociati
1 parent 5da7fe0 commit 094016c

File tree

10 files changed

+40
-29
lines changed

10 files changed

+40
-29
lines changed

C-git-commands.asc

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The `git config` command has been used in nearly every chapter of the book.
1919

2020
In <<ch01-getting-started#r_first_time>> we used it to specify our name, email address and editor preference before we even got started using Git.
2121

22-
In <<ch02-git-basics#r_git_aliases>> we showed how you could use it to create shorthand commands that expand to long option sequences so you don't have to type them every time.
22+
In <<ch02-git-basics-chapter#r_git_aliases>> we showed how you could use it to create shorthand commands that expand to long option sequences so you don't have to type them every time.
2323

2424
In <<ch03-git-branching#r_rebasing>> we used it to make `--rebase` the default when you run `git pull`.
2525

@@ -44,7 +44,7 @@ There are two ways to get a Git repository. One is to copy it from an existing r
4444

4545
To take a directory and turn it into a new Git repository so you can start version controlling it, you can simply run `git init`.
4646

47-
We first introduce this in <<ch02-git-basics#r_getting_a_repo>>, where we show creating a brand new repository to start working with.
47+
We first introduce this in <<ch02-git-basics-chapter#r_getting_a_repo>>, where we show creating a brand new repository to start working with.
4848

4949
We talk briefly about how you can change the default branch from ``master'' in <<ch03-git-branching#r_remote_branches>>.
5050

@@ -58,7 +58,7 @@ The `git clone` command is actually something of a wrapper around several other
5858

5959
The `git clone` command is used in dozens of places throughout the book, but we'll just list a few interesting places.
6060

61-
It's basically introduced and explained in <<ch02-git-basics#r_git_cloning>>, where we go through a few examples.
61+
It's basically introduced and explained in <<ch02-git-basics-chapter#r_git_cloning>>, where we go through a few examples.
6262

6363
In <<ch04-git-server#r_git_on_the_server>> we look at using the `--bare` option to create a copy of a Git repository with no working directory.
6464

@@ -79,7 +79,7 @@ The `git add` command adds content from the working directory into the staging a
7979

8080
This command is an incredibly important command in Git and is mentioned or used dozens of times in this book. We'll quickly cover some of the unique uses that can be found.
8181

82-
We first introduce and explain `git add` in detail in <<ch02-git-basics#r_tracking_files>>.
82+
We first introduce and explain `git add` in detail in <<ch02-git-basics-chapter#r_tracking_files>>.
8383

8484
We mention how to use it to resolve merge conflicts in <<ch03-git-branching#r_basic_merge_conflicts>>.
8585

@@ -91,13 +91,13 @@ Finally, we emulate it at a low level in <<ch10-git-internals#r_tree_objects>>,
9191

9292
The `git status` command will show you the different states of files in your working directory and staging area. Which files are modified and unstaged and which are staged but not yet committed. In it's normal form, it also will show you some basic hints on how to move files between these stages.
9393

94-
We first cover `status` in <<ch02-git-basics#r_checking_status>>, both in it's basic and simplified forms. While we use it throughout the book, pretty much everything you can do with the `git status` command is covered there.
94+
We first cover `status` in <<ch02-git-basics-chapter#r_checking_status>>, both in it's basic and simplified forms. While we use it throughout the book, pretty much everything you can do with the `git status` command is covered there.
9595

9696
==== git diff
9797

9898
The `git diff` command is used when you want to see differences between any two trees. This could be the difference between your working environment and your staging area (`git diff` by itself), between your staging area and your last commit (`git diff --staged`), or between two commits (`git diff master branchB`).
9999

100-
We first look at the basic uses of `git diff` in <<ch02-git-basics#r_git_diff_staged>>, where we show how to see what changes are staged and which are not yet staged.
100+
We first look at the basic uses of `git diff` in <<ch02-git-basics-chapter#r_git_diff_staged>>, where we show how to see what changes are staged and which are not yet staged.
101101

102102
We use it to look for possible whitespace issues before committing with the `--check` option in <<ch05-distributed-git#r_commit_guidelines>>.
103103

@@ -111,15 +111,15 @@ Finally, we use it to effectively compare submodule changes with `--submodule` i
111111

112112
The `git difftool` command simply launches an external tool to show you the difference between two trees in case you want to use something other than the built in `git diff` command.
113113

114-
We only briefly mention this in <<ch02-git-basics#r_git_difftool>>.
114+
We only briefly mention this in <<ch02-git-basics-chapter#r_git_difftool>>.
115115

116116
==== git commit
117117

118118
The `git commit` command takes all the file contents that have been staged with `git add` and records a new permanent snapshot in the database and then moves the branch pointer on the current branch up to it.
119119

120-
We first cover the basics of committing in <<ch02-git-basics#r_committing_changes>>. There we also demonstrate how to use the `-a` flag to skip the `git add` step in daily workflows and how to use the `-m` flag to pass a commit message in on the command line instead of firing up an editor.
120+
We first cover the basics of committing in <<ch02-git-basics-chapter#r_committing_changes>>. There we also demonstrate how to use the `-a` flag to skip the `git add` step in daily workflows and how to use the `-m` flag to pass a commit message in on the command line instead of firing up an editor.
121121

122-
In <<ch02-git-basics#r_undoing>> we cover using the `--amend` option to redo the most recent commit.
122+
In <<ch02-git-basics-chapter#r_undoing>> we cover using the `--amend` option to redo the most recent commit.
123123

124124
In <<ch03-git-branching#r_git_branches_overview>>, we go into much more detail about what `git commit` does and why it does it like that.
125125

@@ -131,7 +131,8 @@ Finally, we take a look at what the `git commit` command does in the background
131131

132132
The `git reset` command is primarily used to undo things, as you can possibly tell by the verb. It moves around the `HEAD` pointer and optionally changes the `index` or staging area and can also optionally change the working directory if you use `--hard`. This final option makes it possible for this command to lose your work if used incorrectly, so make sure you understand it before using it.
133133

134-
We first effectively cover the simplest use of `git reset` in <<ch02-git-basics#r_unstaging>>, where we use it to unstage a file we had run `git add` on.
134+
We first effectively cover the simplest use of `git reset` in
135+
<<ch02-git-basics-chapter#r_unstaging>>, where we use it to unstage a file we had run `git add` on.
135136

136137
We then cover it in quite some detail in <<ch07-git-tools#r_git_reset>>, which is entirely devoted to explaining this command.
137138

@@ -141,15 +142,15 @@ We use `git reset --hard` to abort a merge in <<ch07-git-tools#r_abort_merge>>,
141142

142143
The `git rm` command is used to remove files from the staging area and working directory for Git. It is similar to `git add` in that it stages a removal of a file for the next commit.
143144

144-
We cover the `git rm` command in some detail in <<ch02-git-basics#r_removing_files>>, including recursively removing files and only removing files from the staging area but leaving them in the working directory with `--cached`.
145+
We cover the `git rm` command in some detail in <<ch02-git-basics-chapter#r_removing_files>>, including recursively removing files and only removing files from the staging area but leaving them in the working directory with `--cached`.
145146

146147
The only other differing use of `git rm` in the book is in <<ch10-git-internals#r_removing_objects>> where we briefly use and explain the `--ignore-unmatch` when running `git filter-branch`, which simply makes it not error out when the file we are trying to remove doesn't exist. This can be useful for scripting purposes.
147148

148149
==== git mv
149150

150151
The `git mv` command is a thin convenience command to move a file and then run `git add` on the new file and `git rm` on the old file.
151152

152-
We only briefly mention this command in <<ch02-git-basics#r_git_mv>>.
153+
We only briefly mention this command in <<ch02-git-basics-chapter#r_git_mv>>.
153154

154155
==== git clean
155156

@@ -211,7 +212,7 @@ The `git log` command is used to show the reachable recorded history of a projec
211212

212213
This command is used in nearly every chapter of the book to demonstrate the history of a project.
213214

214-
We introduce the command and cover it in some depth in <<ch02-git-basics#r_viewing_history>>. There we look at the `-p` and `--stat` option to get an idea of what was introduced in each commit and the `--pretty` and `--oneline` options to view the history more concisely, along with some simple date and author filtering options.
215+
We introduce the command and cover it in some depth in <<ch02-git-basics-chapter#r_viewing_history>>. There we look at the `-p` and `--stat` option to get an idea of what was introduced in each commit and the `--pretty` and `--oneline` options to view the history more concisely, along with some simple date and author filtering options.
215216

216217
In <<ch03-git-branching#r_create_new_branch>> we use it with the `--decorate` option to easily visualize where our branch pointers are located and we also use the `--graph` option to see what divergent histories look like.
217218

@@ -235,7 +236,7 @@ This is basically entirely covered in <<ch07-git-tools#r_git_stashing>>.
235236

236237
The `git tag` command is used to give a permanent bookmark to a specific point in the code history. Generally this is used for things like releases.
237238

238-
This command is introduced and covered in detail in <<ch02-git-basics#r_git_tagging>> and we use it in practice in <<ch05-distributed-git#r_tagging_releases>>.
239+
This command is introduced and covered in detail in <<ch02-git-basics-chapter#r_git_tagging>> and we use it in practice in <<ch05-distributed-git#r_tagging_releases>>.
239240

240241
We also cover how to create a GPG signed tag with the `-s` flag and verify one with the `-v` flag in <<ch07-git-tools#r_signing>>.
241242

@@ -248,7 +249,7 @@ There are not very many commands in Git that access the network, nearly all of t
248249

249250
The `git fetch` command communicates with a remote repository and fetches down all the information that is in that repository that is not in your current one and stores it in your local database.
250251

251-
We first look at this command in <<ch02-git-basics#r_fetching_and_pulling>> and we continue to see examples of it use in <<ch03-git-branching#r_remote_branches>>.
252+
We first look at this command in <<ch02-git-basics-chapter#r_fetching_and_pulling>> and we continue to see examples of it use in <<ch03-git-branching#r_remote_branches>>.
252253

253254
We also use it in several of the examples in <<ch05-distributed-git#r_contributing_project>>.
254255

@@ -260,7 +261,8 @@ We set up highly custom refspecs in order to make `git fetch` do something a lit
260261

261262
The `git pull` command is basically a combination of the `git fetch` and `git merge` commands, where Git will fetch from the remote you specify and then immediately try to merge it into the branch you're on.
262263

263-
We introduce it quicking in <<ch02-git-basics#r_fetching_and_pulling>> and show how to see what it will merge if you run it in <<ch02-git-basics#r_inspecting_remote>>.
264+
We introduce it quicking in <<ch02-git-basics-chapter#r_fetching_and_pulling>> and
265+
show how to see what it will merge if you run it in <<ch02-git-basics-chapter#r_inspecting_remote>>.
264266

265267
We also see how to use it to help with rebasing difficulties in <<ch03-git-branching#r_rebase_rebase>>.
266268

@@ -272,11 +274,12 @@ Finally, we very quickly mention that you can use the `--verify-signatures` opti
272274

273275
The `git push` command is used to communicate with another repository, calculate what your local database has that the remote one does not, and then pushes the difference into the other repository. It requires write access to the other repository and so normally is authenticated somehow.
274276

275-
We first look at the `git push` command in <<ch02-git-basics#r_pushing_remotes>>. Here we cover the basics of pushing a branch to a remote repository. In <<ch03-git-branching#r_pushing_branches>> we go a little deeper into pushing specific branches and in <<ch03-git-branching#r_tracking_branches>> we see how to set up tracking branches to automatically push to. In <<ch03-git-branching#r_delete_branches>> we use the `--delete` flag to delete a branch on the server with `git push`.
277+
We first look at the `git push` command in <<ch02-git-basics-chapter#r_pushing_remotes>>. Here we cover the basics of pushing a branch to a remote repository. In <<ch03-git-branching#r_pushing_branches>> we go a little deeper into pushing specific branches and in <<ch03-git-branching#r_tracking_branches>> we see how to set up tracking branches to automatically push to. In <<ch03-git-branching#r_delete_branches>> we use the `--delete` flag to delete a branch on the server with `git push`.
276278

277279
Throughout <<ch05-distributed-git#r_contributing_project>> we see several examples of using `git push` to share work on branches through multiple remotes.
278280

279-
We see how to use it to share tags that you have made with the `--tags` option in <<ch02-git-basics#r_sharing_tags>>.
281+
We see how to use it to share tags that you have made with the `--tags` option in
282+
<<ch02-git-basics-chapter#r_sharing_tags>>.
280283

281284
In <<ch07-git-tools#r_publishing_submodules>> we use the `--recurse-submodules` option to check that all of our submodules work has been published before pushing the superproject, which can be really helpful when using submodules.
282285

@@ -288,7 +291,7 @@ Finally, in <<ch10-git-internals#r_pushing_refspecs>> we look at pushing with a
288291

289292
The `git remote` command is a management tool for your record of remote repositories. It allows you to save long URLs as short handles, such as ``origin'' so you don't have to type them out all the time. You can have several of these and the `git remote` command is used to add, change and delete them.
290293

291-
This command is covered in detail in <<ch02-git-basics#r_remote_repos>>, including listing, adding, removing and renaming them.
294+
This command is covered in detail in <<ch02-git-basics-chapter#r_remote_repos>>, including listing, adding, removing and renaming them.
292295

293296
It is used in nearly every subsequent chapter in the book too, but always in the standard `git remote add <name> <url>` format.
294297

@@ -310,7 +313,7 @@ This command is only mentioned and entirely covered in <<ch07-git-tools#r_git_su
310313

311314
The `git show` command can show a Git object in a simple and human readable way. Normally you would use this to show the information about a tag or a commit.
312315

313-
We first use it to show annotated tag information in <<ch02-git-basics#r_annotated_tags>>.
316+
We first use it to show annotated tag information in <<ch02-git-basics-chapter#r_annotated_tags>>.
314317

315318
Later we use it quite a bit in <<ch07-git-tools#r_revision_selection>> to show the commits that our various revision selections resolve to.
316319

book/01-introduction/sections/what-is-git.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ It is hard to get the system to do anything that is not undoable or to make it e
7171
As with any VCS, you can lose or mess up changes you haven't committed yet, but after you commit a snapshot into Git, it is very difficult to lose, especially if you regularly push your database to another repository.
7272

7373
This makes using Git a joy because we know we can experiment without the danger of severely screwing things up.
74-
For a more in-depth look at how Git stores its data and how you can recover data that seems lost, see <<ch02-git-basics-chapter#_undoing>>.
74+
For a more in-depth look at how Git stores its data and how you can recover data that seems lost, see <<ch02-git-basics-chapter#undoing>>.
7575

7676
==== The Three States
7777

book/03-git-branching/sections/remote-branches.asc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ image::images/remote-branches-3.png[`git fetch` updates your remote references.]
3838

3939
To demonstrate having multiple remote servers and what remote branches for those remote projects look like, let's assume you have another internal Git server that is used only for development by one of your sprint teams.
4040
This server is at `git.team1.ourcompany.com`.
41-
You can add it as a new remote reference to the project you're currently working on by running the `git remote add` command as we covered in <<ch02-git-basics#ch02-git-basics>>.
41+
You can add it as a new remote reference to the project you're currently working
42+
on by running the `git remote add` command as we covered in
43+
<<ch02-git-basics-chapter#ch02-git-basics-chapter>>.
4244
Name this remote `teamone`, which will be your shortname for that whole URL.
4345

4446
.Adding another server as a remote

book/05-distributed-git/sections/maintaining.asc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ There are also subcommands to see what will be recorded, to erase specific resol
418418

419419
(((tags)))(((tags, signing)))
420420
When you've decided to cut a release, you'll probably want to drop a tag so you can re-create that release at any point going forward.
421-
You can create a new tag as discussed in <<ch02-git-basics#ch02-git-basics>>.
421+
You can create a new tag as discussed in
422+
<<ch02-git-basics-chapter#ch02-git-basics-chapter>>.
422423
If you decide to sign the tag as the maintainer, the tagging may look something like this:
423424

424425
[source,console]

book/06-github/sections/3-maintaining.asc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ All you really have to do here is provide a project name; the rest of the fields
2424
For now, just click the ``Create Repository'' button, and boom – you have a new repository on GitHub, named `<user>/<project_name>`.
2525

2626
Since you have no code there yet, GitHub will show you instructions for how create a brand-new Git repository, or connect an existing Git project.
27-
We won't belabor this here; if you need a refresher, check out <<ch02-git-basics#ch02-git-basics>>.
27+
We won't belabor this here; if you need a refresher, check out
28+
<<ch02-git-basics-chapter#ch02-git-basics-chapter>>.
2829

2930
Now that your project is hosted on GitHub, you can give the URL to anyone you want to share your project with.
3031
Every project on GitHub is accessible over HTTP as `https://github.com/<user>/<project_name>`, and over SSH as `git@github.com:<user>/<project_name>`.

book/07-git-tools/sections/reset.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ If we look at the diagram for that command and think about what `git add` does,
219219
image::images/reset-path2.png[]
220220

221221
This is why the output of the `git status` command suggests that you run this to unstage a file.
222-
(See <<ch02-git-basics#r_unstaging>> for more on this.)
222+
(See <<ch02-git-basics-chapter#r_unstaging>> for more on this.)
223223

224224
We could just as easily not let Git assume we meant ``pull the data from HEAD'' by specifying a specific commit to pull that file version from.
225225
We would just run something like `git reset eb43bf file.txt`.

book/07-git-tools/sections/submodules.asc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,9 @@ Here we can see that we're defining a function in a submodule and calling it in
721721

722722
===== Useful Aliases
723723

724-
You may want to set up some aliases for some of these commands as they can be quite long and you can't set configuration options for most of them to make them defaults. We covered setting up Git aliases in <<ch02-git-basics#r_git_aliases>>, but here is an example of what you may want to set up if you plan on working with submodules in Git a lot.
724+
You may want to set up some aliases for some of these commands as they can be
725+
quite long and you can't set configuration options for most of them to make them
726+
defaults. We covered setting up Git aliases in <<ch02-git-basics-chapter#r_git_aliases>>, but here is an example of what you may want to set up if you plan on working with submodules in Git a lot.
725727

726728
[source,console]
727729
----

book/08-customizing-git/sections/config.asc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ $ git tag -s <tag-name>
141141
===== `core.excludesfile`
142142

143143
(((excludes)))(((.gitignore)))
144-
You can put patterns in your project's `.gitignore` file to have Git not see them as untracked files or try to stage them when you run `git add` on them, as discussed in <<ch02-git-basics#r_ignoring>>.
144+
You can put patterns in your project's `.gitignore` file to have Git not see them
145+
as untracked files or try to stage them when you run `git add` on them, as
146+
discussed in <<ch02-git-basics-chapter#r_ignoring>>.
145147

146148
But sometimes you want to ignore certain files for all repositories that you work with.
147149
If your computer is running Mac OS X, you're probably familiar with `.DS_Store` files.

0 commit comments

Comments
 (0)