[Reproduced] gitlab found easy to use in conjunction sourcetree

Reprinted provenance http://blog.csdn.net/u012764358/article/details/62886427

Gitlab and Sourcetree conjunction with implementation code management

This is my first published blog, if insufficient or defective, criticism, hoping to better learning. Recently we came to a foreigner companies, they use code management tool is gitlab, due to the previously never used gitlab, so installing this software also took fresh boss. Now the entire process for everyone to share, hoping to bring more convenient to give.

Ready to work

  • Install git
  • Installation sourcetree
  • Registration gitlab account

Configuring SSH Keys

SSH是目前较可靠,转为远程登录会话和其他网络服务提供安全的协议。利用SSH协议可以有效防止远程管理过程中的信息泄露问题。Git就采用了SSH加密传输协议,加密传输的算法有很多,git可以使用RSA,RSA的核心就是使用一对特定的数字,使用其中一个数字可以用来加密,而另外一个数字可以用来解密。这两个数字就是你在使用git、github和gitlab的时候所遇到的public key 也就是公钥以及private key 私钥。公钥是用来加密的数字,这也就是为什么本级生成了公钥之后,要上传到gitlab、GitHub的原因。从GitHub或gitlab发回来的用公钥加密过的数据,可以用你本地的私钥来还原。如果key丢失,不管是公钥还是私钥,丢失哪一个都不能用,需要重新生成一次然后在gitlab账户中再设置一次就可以了。下面就讲一下如何生成SSH KEYS。

![打开sourcetree工具选中右上角的命令行模式](http://img.blog.csdn.net/20170317142830974?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjc2NDM1OA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)在命令行中输入以下命令生成gitlab服务端和本地git所需要的公钥和私钥:ssh-keygen -t rsa -C "你在gitlab上注册的邮箱地址" ,接着会提示你输入密码(这个没有必要输入,我本人没有输入),然后执行到出现一个矩形框的时候就OK了。这是你会发现C盘当前用户目录下多了一个.ssh文件夹,打开.ssh文件夹会发现两个文件id_rsa和id_rsa.pub,前面的就是私钥,后面的是公钥,用记事本将公钥打开,copy到gitlab->SSH Keys->Key中,copy之后Title中会显示你的邮箱账号(该title是可以随意命名的)。完成之后点击Add key按钮。到这里gitlab端的公钥就配置好了。我们要用到sourcetree来下载代码到本地还要对sourcetree来进行设置。
  • 1
  • 2
  • 3
  • 4

Sourcetree settings

Open sourcetree tool, select Tools -> Options -> General -> SSH client: Select OpenSSH (See the figure below), the reason for selecting OpenSSH is because, if you do not choose the time, then clone the code public key errors will be reported . 
sourcetree first pull code sets

Use pull code to local sourcetree

sourcetree -> Clone / New 
Get Remote code repository to a local
source path is the project address gitlab in, copy came on the line, the goal set up their own path, and then click cloning, wait a download code well, you will see sourcetree interface as follows: 
Cloning view down the code structure
multi when human development is not allowed in the master branch, we need to establish their own branch

Establish development branch

Select the need to create a version branch

Write pictures described here

Click the button to create a branch above the branch 
Here I named develop 
created also click on the push button after the completion of the branch is to create a branch at the far end, to the time required to submit branch pushed to the distal end of the first native code, and then merge request to initiate requests on gitlab , develop and carry out the master branch merge operation by an administrator. 
After the push, we go to see gitlab will find more than a branch develop.

Submit update code

Select branch -> file status in the following figure 
File Status View
we can not scratch the selected file, select Statge Selected button, the file will have to file the staging area, enter the update instructions at the bottom of the input box, and click submit, to this point only exist to a local warehouse, also you need to click a button to push, then will update the remote branch develop, then open gitlab, click the merge request, request the merger. At this point the entire process is completed, welcome to correct me, please indicate the source.

Guess you like

Origin www.cnblogs.com/bobojiang/p/11416785.html