﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-JAVA-文章分类-git/maven</title><link>http://www.blogjava.net/zzzlyr/category/55169.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 23 May 2017 17:14:05 GMT</lastBuildDate><pubDate>Tue, 23 May 2017 17:14:05 GMT</pubDate><ttl>60</ttl><item><title>gitlab 两提交代码方式！</title><link>http://www.blogjava.net/zzzlyr/articles/432310.html</link><dc:creator>张钊钊</dc:creator><author>张钊钊</author><pubDate>Thu, 16 Feb 2017 06:01:00 GMT</pubDate><guid>http://www.blogjava.net/zzzlyr/articles/432310.html</guid><wfw:comment>http://www.blogjava.net/zzzlyr/comments/432310.html</wfw:comment><comments>http://www.blogjava.net/zzzlyr/articles/432310.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zzzlyr/comments/commentRss/432310.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zzzlyr/services/trackbacks/432310.html</trackback:ping><description><![CDATA[gitlab 有两种提交代码方式&nbsp;<br /><br />1：把某一个分支clone到本地，然后修改和增加本地分支的代码，然后commit , 在pull , 在push（会自动合并）,<br /><br />2:把某一个分支clone到本地,然后修改和增加本地分支的代码，然后commit,在fetch , 在rebase 在push（不会动合并）.<br /><br /><br />merge 现个参数： -squash 意思是某个一个分支多次commit被压缩当做一次提交，合并到另一个分支的时候，log 历史只有一次。<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 使用场景：例如一个开发分支可能经常多次commit（这是开发人员经常干的事），但是这么多commit基本上都没有意义。合并的时候压缩只记一次有意义提交历史。<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Fash forward 意思是合并的时候主分支快速向前（不记录提交历史），这样主分支如果相回退到某一个提交历史的话就不行了。<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 使用场景： 基本没有什么重大提交意义的合并和修改，可以选择使用。&nbsp;<br /><br /><br /><img src ="http://www.blogjava.net/zzzlyr/aggbug/432310.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zzzlyr/" target="_blank">张钊钊</a> 2017-02-16 14:01 <a href="http://www.blogjava.net/zzzlyr/articles/432310.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> GitLab配置SSH Key</title><link>http://www.blogjava.net/zzzlyr/articles/432295.html</link><dc:creator>张钊钊</dc:creator><author>张钊钊</author><pubDate>Thu, 09 Feb 2017 08:33:00 GMT</pubDate><guid>http://www.blogjava.net/zzzlyr/articles/432295.html</guid><wfw:comment>http://www.blogjava.net/zzzlyr/comments/432295.html</wfw:comment><comments>http://www.blogjava.net/zzzlyr/articles/432295.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zzzlyr/comments/commentRss/432295.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zzzlyr/services/trackbacks/432295.html</trackback:ping><description><![CDATA[<h1>1.环境配置</h1><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">首先安装<a href="https://git-scm.com/downloads" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">Git</a>和<a href="https://tortoisegit.org/download/" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">TortoiseGit</a>，不要问我为什么要装TortoiseGit，不知道为什么，就是喜欢小乌龟。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><a href="https://git-scm.com/downloads" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">Git下载</a>&nbsp;<br style="box-sizing: border-box;" /><a href="https://tortoisegit.org/download/" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">TortoiseGit下载</a>&nbsp;<br style="box-sizing: border-box;" />这里有打包好的：&nbsp;<br style="box-sizing: border-box;" /><a href="http://download.csdn.net/detail/kong_gu_you_lan/9694241" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">32bit下载</a>&nbsp;/&nbsp;<a href="http://download.csdn.net/detail/kong_gu_you_lan/9694242" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">64bit下载</a></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">安装还是比较简单的，一路默认选项下一步就可以了，因为的我的电脑系统是Windows 10的，安装的时候遇到了2502、2503报错，这是由于安装权限不足造成的，也很好解决，使用命令行安装就好了，<a href="http://jingyan.baidu.com/article/a501d80cec07daec630f5e18.html" style="text-decoration: none; box-sizing: border-box; color: #0c89cf;">戳这里查看解决方法</a>&nbsp;。</p><h1><a name="t1" style="box-sizing: border-box; color: rgb(12, 137, 207);"></a>2.配置SSH Key</h1><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">OK，到这里环境已经安装完成了，接下来就要生成SSH Key了。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">首先在TortoiseGit的安装目录下的bin文件夹中找到puttygen.exe这个工具（如果你没有选择安装目录的话，默认路径应该是C:\Program Files\TortoiseGit\bin），这个工具是用来生成密钥对的，打开它点击Generate，然后鼠标在进度条下方不停的晃动，几秒后就会生成密钥对，点击Sava private key保存私钥到本地（输入一个名字，保存到一个你找的到的文件夹），不要关闭这个窗口，接下来还会用到。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20161126111509993" alt="生成密钥对" title="" style="border: none; box-sizing: border-box; max-width: 602px; height: auto;" /></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">打开GitLab，找到Profile settings（右上角）下的SSH keys选项，选择Add SSH Key，Title输入框里输入一个名称（随便写），然后把上面生成的以ssh-rsa开头的一长串密钥复制到Key输入框，点击Add Key保存。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20161126112437480" alt="添加SSH Key" title="" style="border: none; box-sizing: border-box; max-width: 602px; height: auto;" /></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20161126112446069" alt="添加SSH Key" title="" style="border: none; box-sizing: border-box; max-width: 602px; height: auto;" /></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">到这里SSH Key就配置成功了，刚才生成密钥对的窗口可以关闭了。</p><h1><a name="t2" style="box-sizing: border-box; color: rgb(12, 137, 207);"></a>3.在本地的项目中配置SSH key</h1><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">在项目的文件夹上右击鼠标，选择TortoiseGit&#8212;Settings&#8212;Remot，在Putty Key后选择刚才保存到本地的私钥，然后点击应用。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20161127183314765" alt="配置SSH key]" title="" style="border: none; box-sizing: border-box; max-width: 602px; height: auto;" /></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">设置SSH客户端，选择Network选项，在下面的SSH Client选项中选择TortoiseGit的安装目录下bin文件夹中的TortoiseGitPlink.exe程序，如果已经默认选中，直接确定就可以了。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20161126125505474" alt="设置SSH客户端" title="" style="border: none; box-sizing: border-box; max-width: 602px; height: auto;" /></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">在Pull或Push项目的时候，记得勾选Autoload Putty Key选项。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20161126114826960" alt="自动加载Putty Key" title="" style="border: none; box-sizing: border-box; max-width: 602px; height: auto;" /></p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">到这里，GitLab配置SSH Key就已经全部完成了，再也不用麻烦运维的小伙伴了。</p><p style="margin: 0px 0px 1.1em; padding: 0px; box-sizing: border-box; color: #555555; font-family: 'microsoft yahei'; line-height: 35px; background-color: #ffffff;">GitHub也可以使用此方法配置SSH Key，在Personal settings&#8212;SSH and GPG keys&#8212;SSH keys选项下选择New SSH Key就可以了。</p><h1>注意最后clone时候地址使用<br /><br />URL: &nbsp;<span style="font-size: 14px;">git@git.XXXX.com:ybz/SSC_server.git 前面不用加任任何东西，我就加了ssh://东西弄了好久都clone不下来。</span></h1><img src ="http://www.blogjava.net/zzzlyr/aggbug/432295.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zzzlyr/" target="_blank">张钊钊</a> 2017-02-09 16:33 <a href="http://www.blogjava.net/zzzlyr/articles/432295.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>