Commit 4ce9a783 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

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
parents b06acbf5 db326604
...@@ -324,6 +324,7 @@ v 8.11.7 ...@@ -324,6 +324,7 @@ v 8.11.7
- Avoid conflict with admin labels when importing GitHub labels. !6158 - Avoid conflict with admin labels when importing GitHub labels. !6158
- Restores `fieldName` to allow only string values in `gl_dropdown.js`. !6234 - Restores `fieldName` to allow only string values in `gl_dropdown.js`. !6234
- Allow the Rails cookie to be used for API authentication. - Allow the Rails cookie to be used for API authentication.
- Updating verbiage on git basics to be more intuitive
v 8.11.6 v 8.11.6
- Fix unnecessary horizontal scroll area in pipeline visualizations. !6005 - Fix unnecessary horizontal scroll area in pipeline visualizations. !6005
......
# Start using Git on the command line # Start using Git on the command line
If you want to start using a Git and GitLab, make sure that you have created an If you want to start using Git and GitLab, make sure that you have created and/or signed into an account on GitLab.
account on GitLab.
## Open a shell ## 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 - [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: ...@@ -22,19 +21,19 @@ Type the following command and then press enter:
git --version git --version
``` ```
You should receive a message that will tell you which Git version you have in your computer. If you don’t 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 don’t 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. 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 ## 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: 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: Then verify that you have the correct username:
...@@ -44,7 +43,7 @@ git config --global user.name ...@@ -44,7 +43,7 @@ git config --global user.name
To set your email address, type the following command: 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: To verify that you entered your email correctly, type:
...@@ -52,7 +51,7 @@ 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 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 you’re 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 you’re in that project.
## Check your information ## Check your information
...@@ -76,7 +75,7 @@ git pull REMOTE NAME-OF-BRANCH -u ...@@ -76,7 +75,7 @@ git pull REMOTE NAME-OF-BRANCH -u
(REMOTE: origin) (NAME-OF-BRANCH: could be "master" or an existing branch) (REMOTE: origin) (NAME-OF-BRANCH: could be "master" or an existing branch)
### Create a 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 git checkout -b NAME-OF-BRANCH
``` ```
...@@ -127,4 +126,3 @@ You need to be in the master branch. ...@@ -127,4 +126,3 @@ You need to be in the master branch.
git checkout master git checkout master
git merge NAME-OF-BRANCH git merge NAME-OF-BRANCH
``` ```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment