Merge branch 'jerdog/gitlab-ce-update-start-using-git-documentation' into 'master'

Changes to make Git basics more intuitive

From https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6420

See merge request !6777
This commit is contained in:
Achilleas Pipinellis 2016-10-10 15:04:06 +00:00
commit 4ce9a783b5
2 changed files with 10 additions and 11 deletions

View File

@ -324,6 +324,7 @@ v 8.11.7
- Avoid conflict with admin labels when importing GitHub labels. !6158
- Restores `fieldName` to allow only string values in `gl_dropdown.js`. !6234
- Allow the Rails cookie to be used for API authentication.
- Updating verbiage on git basics to be more intuitive
v 8.11.6
- Fix unnecessary horizontal scroll area in pipeline visualizations. !6005

View File

@ -1,11 +1,10 @@
# Start using Git on the command line
If you want to start using a Git and GitLab, make sure that you have created an
account on GitLab.
If you want to start using Git and GitLab, make sure that you have created and/or signed into an account on GitLab.
## Open a shell
Depending on your operating system, find the shell of your preference. Here are some suggestions.
Depending on your operating system, you will need to use a shell of your preference. Here are some suggestions:
- [Terminal](http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line) on Mac OSX
@ -22,19 +21,19 @@ Type the following command and then press enter:
git --version
```
You should receive a message that will tell you which Git version you have in your computer. If you dont receive a "Git version" message, it means that you need to [download Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
You should receive a message that will tell you which Git version you have on your computer. If you dont receive a "Git version" message, it means that you need to [download Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
If Git doesn't automatically download, there's an option on the website to [download manually](https://git-scm.com/downloads). Then follow the steps on the installation window.
After you finished installing, open a new shell and type "git --version" again to verify that it was correctly installed.
After you are finished installing, open a new shell and type "git --version" again to verify that it was correctly installed.
## Add your Git username and set your email
It is important because every Git commit that you create will use this information.
It is important to configure your Git username and email address as every Git commit will use this information to identify you as the author.
On your shell, type the following command to add your username:
```
git config --global user.name ADD YOUR USERNAME
git config --global user.name "YOUR_USERNAME"
```
Then verify that you have the correct username:
@ -44,7 +43,7 @@ git config --global user.name
To set your email address, type the following command:
```
git config --global user.email ADD YOUR EMAIL
git config --global user.email "your_email_address@example.com"
```
To verify that you entered your email correctly, type:
@ -52,7 +51,7 @@ To verify that you entered your email correctly, type:
git config --global user.email
```
You'll need to do this only once because you are using the "--global" option. It tells Git to always use this information for anything you do on that system. If you want to override this with a different username or email address for specific projects, you can run the command without the "--global" option when youre in that project.
You'll need to do this only once as you are using the `--global` option. It tells Git to always use this information for anything you do on that system. If you want to override this with a different username or email address for specific projects, you can run the command without the `--global` option when youre in that project.
## Check your information
@ -76,7 +75,7 @@ git pull REMOTE NAME-OF-BRANCH -u
(REMOTE: origin) (NAME-OF-BRANCH: could be "master" or an existing branch)
### Create a branch
Spaces won't be recognized, so you need to use a hyphen or underscore.
Spaces won't be recognized, so you will need to use a hyphen or underscore.
```
git checkout -b NAME-OF-BRANCH
```
@ -127,4 +126,3 @@ You need to be in the master branch.
git checkout master
git merge NAME-OF-BRANCH
```