Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 01 introduction #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions book/01-introduction/sections/first-time-setup.asc
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
[[r_first_time]]
=== First-Time Git Setup
=== Impostare Git per la prima volta

Now that you have Git on your system, you'll want to do a few things to customize your Git environment.
You should have to do these things only once on any given computer; they'll stick around between upgrades.
You can also change them at any time by running through the commands again.
Ora che Git è istallato sul tuo sistema, dovrai fare alcune cose per impostare Git.
Dovrai fare queste cose solamente una volta su ogni computer; rimarranno anche tra gli aggiornamenti.
Potrai anche cambiarle quando vorrai eseguendo nuovamente i comandi.

Git comes with a tool called `git config` that lets you get and set configuration variables that control all aspects of how Git looks and operates.(((git commands, config)))
These variables can be stored in three different places:
Git dispone di uno strumento chiamato `git config` che ti permetterà di impostare le variabili di configurazione che controllano tutti gli aspetti di come Git funziona e come viene visualizzato.(((git commands, config)))
Queste variabili possono essere salvate in tre differenti posti:

1. `/etc/gitconfig` file: Contains values for every user on the system and all their repositories.
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
2. `~/.gitconfig` or `~/.config/git/config` file: Specific to your user.
You can make Git read and write to this file specifically by passing the `--global` option.
3. `config` file in the Git directory (that is, `.git/config`) of whatever repository you're currently using: Specific to that single repository.
1. Nel file `/etc/gitconfig`: Contiene i valori per ogni utente sul sistema e i suoi repository.
Passando l'opzione `--system` a `git config`, leggerà e scriverà specificamente su questo file.
2. Nel file `~/.gitconfig` o `~/.config/git/config`: Specifico per l'utente.
Puoi fare in modo che Git legga e scriva su questo specificamente su questo file passando l'opzione `--global`.
3. Nel file `config` nella cartella di Git (che corrisponde a `.git/config`) di qualunque repository tu stia attualmente utilizzando: Specifico per quel singolo repository.

Each level overrides values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`.
Ogni livello prevale su quello precedente, quindi i valori in `.git/config` prevalgono su quelli in `/etc/gitconfig`.

On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people).
It also still looks for `/etc/gitconfig`, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
Sui sistemi Windows, Git cerca il file `.gitconfig` nella cartella `$HOME` (`C:\Users\$USER` per la maggior parte delle persone).
Git cerca anche in `/etc/gitconfig`, anche se è relativo alla root di MSys, che è dove decidi di installare Git sui sistemi Windows quando fai partire l'installazione.

==== Your Identity
==== La tua identità

The first thing you should do when you install Git is to set your user name and e-mail address.
This is important because every Git commit uses this information, and it's immutably baked into the commits you start creating:
La prima cosa che dovresti fare quando installi Git è impostare il tuo nome e indirizzo e-mail.
Questo è importante poiché ogni commit in Git usa queste informazioni, e sarà immutabilmente impresso nei commit che creerai:

[source,console]
----
$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
----

Again, you need to do this only once if you pass the `--global` option, because then Git will always use that information for anything you do on that system.
If you want to override this with a different name or e-mail address for specific projects, you can run the command without the `--global` option when you're in that project.
Dovrai fare questa operazione solamente una volta se usi l'opzione `--global`, perché allora Git userà sempre quell'informazione per tutte le operazione che farai su quel sistema.
Se vuoi utilizzare un nome o un indirizzo e-mail diverso per uno specifico progetto, puoi utilizzare il comando senza l'opzione `--global` quando sei in quel progetto.

Many of the GUI tools will help you do this when you first run them.
Molte delle interfacce grafiche ti aiuteranno a farlo al primo avvio.

==== Your Editor
==== Il tuo editor

Now that your identity is set up, you can configure the default text editor that will be used when Git needs you to type in a message.
If not configured, Git uses your system's default editor, which is generally Vim.
If you want to use a different text editor, such as Emacs, you can do the following:
Ora che la tua identità è stata impostata, puoi configurare il tuo editor di testo predefinito che Git userà quando ti chiederà di scrivere un commento.
Se non configurato, Git userà l'editor predefinito del sistema, generalmente Vim.
Se vuoi utilizzare un editor diverso, come Emacs, puoi fare nel seguente modo:

[source,console]
----
Expand All @@ -48,13 +48,13 @@ $ git config --global core.editor emacs

[WARNING]
====
Vim and Emacs are popular text editors often used by developers on Unix based systems like Linux and Mac. If you are not familiar with either of these editors or are on a Windows system, you may need to search for instructions for how to set up your favorite editor with Git.
If you don't set an editor like this and you don't know what Vim or Emacs are, you will likely get into a really confusing state when they are launched.
Vim ed Emacs sono degli editor di testo popolari utilizzati dagli sviluppatori su sistemi basati su Unix come Linux e Mac. Se non sei familiare con nessuno dei due o se sei su un sistema Windows, dovrai cercare le istruzioni per impostare il tuo editor preferito con Git.
Se non imposti un editor così, e non sai cosa sono Vim o Emacs, finirai in una grande confusione quando verranno lanciati.
====

==== Checking Your Settings
==== Controlla le impostazioni

If you want to check your settings, you can use the `git config --list` command to list all the settings Git can find at that point:
Se vuoi controllare le tue impostazioni, puoi usare il comando `git config --list` per mostrare tutte le impostazioni che Git trova in quel punto:

[source,console]
----
Expand All @@ -68,10 +68,10 @@ color.diff=auto
...
----

You may see keys more than once, because Git reads the same key from different files (`/etc/gitconfig` and `~/.gitconfig`, for example).
In this case, Git uses the last value for each unique key it sees.
Vedrai alcune chiavi più di una volta, perché Git legge le stesse chiavi da diversi file (`/etc/gitconfig` e `~/.gitconfig`, per esempio).
In questo caso, Git utilizza l'ultimo valore per ogni chiave univoca che vede.

You can also check what Git thinks a specific key's value is by typing `git config <key>`:(((git commands, config)))
Puoi anche controllare quale valore pensa Git per una specifica chiave scrivendo `git config <key>`:(((git commands, config)))

[source,console]
----
Expand Down
85 changes: 42 additions & 43 deletions book/01-introduction/sections/installing.asc
Original file line number Diff line number Diff line change
@@ -1,79 +1,78 @@
=== Installing Git
=== Installare Git

Before you start using Git, you have to make it available on your computer.
Even if it's already installed, it's probably a good idea to update to the latest version.
You can either install it as a package or via another installer, or download the source code and compile it yourself.
Prima di iniziare a usare Git, bisogna installarlo sul tuo computer.
Anche se è già installato, probabilmente è una buona idea aggiornarlo all'ultima versione.
Puoi decidere di installarlo come un pacchetto oppure tramite un installatore, oppure scaricare il codice sorgente e compilarlo da solo.

[NOTE]
====
This book was written using Git version *2.0.0*. Though most of the commands we use should work even in ancient versions of Git, some of them might not or might act slightly differently if you're using an older version. Since Git is quite excellent at preserving backwards compatibility, any version after 2.0 should work just fine.
Questo libro è stato scritto utilizzando la versione di Git *2.0.0*. Anche se la maggior parte dei comandi dovrebbe funzionare anche con vecchie versioni di Git, alcuni di loro potrebbero funzionare diversamente se utilizzi una vecchia versione. Dato che Git è eccellete a preservare la compatibilità con vecchie versioni, le versioni dopo la 2.0 dovrebbero funzionare bene.
====

==== Installing on Linux
==== Installazione su Linux

(((Linux, installing)))
If you want to install Git on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution.
If you're on Fedora for example, you can use yum:
Se vuoi installare Git su Linux con un installatore, generalmente puoi farlo tramite lo strumento di gestione dei pacchetti che è presente sulla tua distribuzione.
Se per esempio usi Fedora, puoi usare yum:

$ yum install git

If you're on a Debian-based distribution like Ubuntu, try apt-get:
Se usi distribuzioni basate su Debian, come Ubuntu, prova apt-get:

$ apt-get install git

For more options, there are instructions for installing on several different Unix flavors on the Git website, at http://git-scm.com/download/linux[].
Per altre opzioni, ci sono istruzioni per installarlo per diversi sistemi Unix sul sito di Git all'indirizzo http://git-scm.com/download/linux[].

==== Installing on Mac
==== Installazione su Mac

(((Mac, installing)))
There are several ways to install Git on a Mac.
The easiest is probably to install the Xcode Command Line Tools.(((Xcode)))
On Mavericks (10.9) or above you can do this simply by trying to run 'git' from the Terminal the very first time.
If you don't have it installed already, it will prompt you to install it.
Ci sono diversi modi per installare Git su Mac.
Il più semplice è probabilmente installare gli strumenti per linea di comando di Xcode.(((Xcode)))
Su Mavericks (10.9) o superiori puoi farlo semplicemente provando a eseguire 'git' dal terminale per la prima volta.
Se non lo hai già installato, ti chiederà di installarlo.

If you want a more up to date version, you can also install it via a binary installer.
An OSX Git installer is maintained and available for download at the Git website, at http://git-scm.com/download/mac[].
Se desideri una versione più aggiornata, puoi installarlo tramite un installatore.
Un installatore per OSX è mantenuto e disponibile sul sito di Git all'indirizzo http://git-scm.com/download/mac[].

.Git OS X Installer.
image::images/git-osx-installer.png[Git OS X installer.]
.Installatore di Git per OS X.
image::images/git-osx-installer.png[Installatore di Git per OS X.]

You can also install it as part of the GitHub for Mac install.
Their GUI Git tool has an option to install command line tools as well.
You can download that tool from the GitHub for Mac website, at http://mac.github.com[].
Puoi anche installarlo come parte di GitHub per Mac.
La loro interfaccia di Git ha anche un'opzione per installare gli strumenti per linea di comando.
Puoi scaricare questo strumento dal sito web di GitHub per Mac, all'indirizzo http://mac.github.com[].

==== Installing on Windows
==== Installazione su Windows

There are also a few ways to install Git on Windows.(((Windows, installing)))
The most official build is available for download on the Git website.
Just go to http://git-scm.com/download/win[] and the download will start automatically.
Note that this is a project called Git for Windows (also called msysGit), which is separate from Git itself; for more information on it, go to http://msysgit.github.io/[].
Ci sono anche alcuni modi per installare Git su Windows.(((Windows, installing)))
La build ufficiale è disponibile sul sito web di Git.
Collegati all'indirizzo http://git-scm.com/download/win[] e il download inizierà in automatico.
Nota che il progetto si chiama Git per Windows (anche chiamato msysGit), che è separato da Git stesso; per ulteriori informazioni, vai su http://msysgit.github.io/[].

Another easy way to get Git installed is by installing GitHub for Windows.
The installer includes a command line version of Git as well as the GUI.
It also works well with Powershell, and sets up solid credential caching and sane CRLF settings.(((Powershell)))(((CRLF)))(((credential caching)))
We'll learn more about those things a little later, but suffice it to say they're things you want.
You can download this from the GitHub for Windows website, at http://windows.github.com[].
Un altro metodo semplice per installare Git è installando GitHub per Windows.
L'installatore include una versione a linea di comando di Git e anche un'interfaccia grafica.
Funziona anche bene con Powershell, e imposta un solido caching delle credenziali e comode impostazioni per CRLF.(((Powershell)))(((CRLF)))(((credential caching)))
Impareremo di più riguardo a queste cose più tardi, ma è sufficiente dire che sono cose che servono.
Puoi scaricarlo dal sito web di GitHub per Windows, all'indirizzo http://windows.github.com[].

==== Installazione dal codice sorgente

==== Installing from Source
Alcune persone pensano che sia utile installare Git dal codice sorgente, poiché fornisce la versione più recente.
L'installatore tende a essere un po' indietro, anche se Git è maturato molto negli ultimi anni, non ci sono molte differenze.

Some people may instead find it useful to install Git from source, because you'll get the most recent version.
The binary installers tend to be a bit behind, though as Git has matured in recent years, this has made less of a difference.

If you do want to install Git from source, you need to have the following libraries that Git depends on: curl, zlib, openssl, expat, and libiconv.
For example, if you're on a system that has yum (such as Fedora) or apt-get (such as a Debian based system), you can use one of these commands to install all of the dependencies:
Se desideri installare Git dal codice sorgente, dovrai avere le seguenti librerie su cui Git dipende: curl, zlib, openssl, expat e libiconv.
Per esempio, se sei su un sistema che utilizza yum (come Fedora) oppure apt-get (come sui sistemi basati su Debian), puoi utilizzare uno di questi comandi per installare tutte le dipendenze:

$ yum install curl-devel expat-devel gettext-devel \
openssl-devel zlib-devel

$ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \
libz-dev libssl-dev

When you have all the necessary dependencies, you can go ahead and grab the latest tagged release tarball from several places.
You can get it via the Kernel.org site, at https://www.kernel.org/pub/software/scm/git[], or the mirror on the GitHub web site, at https://github.com/git/git/releases[].
It's generally a little clearer what the latest version is on the GitHub page, but the kernel.org page also has release signatures if you want to verify your download.
Quando avrai tutte le dipendenze necessarie, puoi proseguire prendendo l'ultima tarball rilasciata da diversi posti.
Puoi ottenerlo dal sito web Kernel.org, all'indirizzo https://www.kernel.org/pub/software/scm/git[], oppure dal mirror sul sito web di GitHub, all'indirizzo https://github.com/git/git/releases[].
Generalmente è più chiaro qual è l'ultima versione sulla pagina di GitHub, ma kernel.org ha anche le firme delle release se vuoi verificare il download.

Then, compile and install:
In seguito, compila e installa:

$ tar -zxf git-1.9.1.tar.gz
$ cd git-1.9.1
Expand All @@ -82,6 +81,6 @@ Then, compile and install:
$ make all doc info
$ sudo make install install-doc install-html install-info

After this is done, you can also get Git via Git itself for updates:
Dopo questo è tutto pronto, puoi ottenere Git tramite Git stesso per gli aggiornamenti:

$ git clone git://git.kernel.org/pub/scm/git/git.git