Gitlab Client Simple use

Source: Internet
Author: User

Because there is a previous article is Gitlab source code compilation, if is fastidious efficiency and simple words can install Gitlab rpm. Here is a brief record of my recent use of Gitlab.

Requirements: A clean system is required


First, install the necessary dependencies


sudo yum install Openssh-server


sudo yum install postfix


sudo yum install Cronie


sudo service postfix start


sudo chkconfig postfix on


sudo lokkit-s http-s ssh (This is a firewall, in fact, I do not understand the deep.) )


Second, download omnibus package and install


(1) Curl-o https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-ce-7.10.0~omnibus.2-1.x86_64.rpm

sudo rpm-i gitlab-ce-7.10.0~omnibus.2-1.x86_64.rpm,


Then execute: Gitlab-ctl reconfig (RECOMPILE)

In fact, your gitlab has been able to access it. Here's a simple configuration to modify your needs.

Username:root

Password:5ivel!fe


Third, modify the configuration


When I send a message in the test: echo "This is test email" |mail-s "test Email" [Email protected]

It is obvious that the name from [email protected] is not what we want. or change to their own domain name, or change to their own IP.


According to my configuration:

Want to modify domain name: vim/var/opt/gitlab/gitlab-rails/etc/gitlab.yml

(1) Host (2) Email_from two

is to stop the Gitlab service first.

To modify the configuration file after saving

Start the Gitlab service again.

Finish Live

Your configuration has been modified.


Some people say change/etc/gitlab/gitlab.rb, but I didn't try.

You can see the mail trial by viewing the log: Tail-f/var/log/maillog.


Iv. Gitlab Client Use


1. Create user


(1) Name

(2) Username

(3) Email

(4) Password (if you have no problem with the mailbox, you can prompt the user to change their password.) If your mail is blocked. The log will prompt for the sending timeout, presumably because your postfix service is not registered and cannot be sent all the time. You can reset your password by clicking on the user's exit (edit). )

The rest of them can be explored on their own. The above is the creation user must go to assign value.


2. Verify Login

。。。。。。。。 omitted here.


3. Install the client (Windows)


(1) Git and tortoisegit are required for installation

All I choose is the default.

After the installation is complete.

(2) User Login

The first is to generate the key:

In Git-bash:

You can look ahead: git config--list

Determine the local user of the Gitlab

git config--global user.name "username"

git config--global user.email "your_email_address"


Ssh-keygen-t rsa-c your_email_address


Go to your local user directory. There should be two files (Id_rsa id_rsa.pub) in the SSH directory.

You need to open the public key file to copy the contents of the file into the SSH keys in the Web login Gitlab.

Click Add SSH Key

The title can be casual. Copy the above contents to the bottom.

Verification: ssh-t [email Protected]_gitlabserver

If it appears: Welcom to gitlab,yourname!

Explain the success of the certification!


4, Warehouse use


1) Create a local warehouse

Create a folder

Git bash:

CD C:

Mkdir-p www/testgit/

CD Www/testgit


Git init (initialize: Use the command git init to turn this directory into a repository that git can manage, as below)

(2) Add File to Repository

Vim Test.txt

11111

Step one: Use the command git add test.txt to staging area inside.

: Git add test.txt

Without any hint, the description has been added successfully.


git Add File

When appears: similar to Warning:lf'll be replaced by CRLF

Follow the steps below:

First: Rm-rf. git

Git init

git config--global core.autocrlf false

Then load the file into memory.

Step Two: use the command git commit to tell git to submit the file to the repository.

: Git commit-m "Tips"

If prompt is displayed, the execution succeeds.

Step three: Now that we have submitted a Readme.txt file, we can see if there are any files that have not yet been submitted under the command git status below:

: Git status

Nothing to commit ...
Description Execution succeeded:
The rest is you can go to your local folder there is a Test.txt file that indicates that the local library was created successfully,

understand the difference between a workspace and a staging area?
Workspace: The directory you see on your computer, such as the files in Testgit (except the. git hidden directory repository). or later, you need to create a new directory file, and so on is the workspace category.
Repository (Repository): The workspace has a hidden directory. Git, this does not belong to the workspace, this is the repository. The repository contains a lot of things, the most important of which is the stage (staging area), and Git automatically created the first branch master for us, and a pointer to master head.
As we said earlier, using Git to submit a file to the repository has two steps:
The first step is to add the file using git add, which is actually adding the file to the staging area.
The second step: Commit the change using git commit, which is actually committing all the contents of staging area to the current branch.

5. Upload Remote Library

now, after we've created a git repository locally, we want to create a git repository on GitHub, and we want the two warehouses to be synchronized remotely so that GitHub's warehouses can be backed up and others can collaborate through the warehouse.
(1) First landing page Gitlab create a project:
because we are SSH certified by all options SSH:
For example: [email protected]:/username/test-git.git as a remote directory.
The test-git here is the name of the directory you just created.
(2)
so in the local warehouse execution:
git remote add origin [email protected]:/username/test-git.git
at this point, you determine your remote directory and the default is to upload to the project.
git push-u Origin master
Since the remote library is empty, and when we first push the master branch, with the –u parameter, GIT will not only push the local master branch content to the remote new Master branch, but also associate the local master branch with the remote Master branch. You can simplify the command at a later push or pull. Once the push is successful, you can see the remote library's contents in the GitHub page as if it were local.

From now on, as long as the local commits, you can use the following command: Git push origin master You can go to the Web version to view the content of the local repository ... You can create a project (Test2-git) on the Web page: Git clone [email protected]:/username/test2-git.git wait for your local repository to have the item you just created ... There may be a lot of deficiencies. I hope you will correct me a lot. This is just some of the problems I have encountered in my own experiments. Reference Document: Installing the gitlab:http://segmentfault.com/a/1190000002722631 installation client: http://blog.jobbole.com/78960/

This article from "The Dark before Dawn" blog, declined reprint!

Gitlab Client Simple use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.