<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[git孤立分支的使用情况是什么？Git 入怼之独立分支。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[版本控制]]></category>
<pubDate>Mon, 25 Sep 2017 03:26:34 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	&nbsp;&nbsp;&nbsp;&nbsp; git中可以承载多个DAGs Repo一样的情况 git checkout --orphan命令。 git的常见用例是此功能是保持独立的文档和github的gh pages孤立的分支branch来创建一个静态网站。<br/>孤立分支特征：<br/>1）master好孤立分支是一个.git仓库里面的两颗独立的数，也就是说他俩没法合并。<br/>2）master默认是保护的，建议把master 干掉，默认保护master的变为master.andorid,类似这样的。<br/>3）孤立分支里面再建立分支，他们之间和常规分支一样的，没有区别。<br/>一）其他用例孤立的分支有哪些？<br/>可能的用法是用于将多个系统信息库组合成一个。 是一些例子：<br/>Combining多个git库?<br/>在这些情况下你必须在同一个档案库中的两个独立DAG之前合并到一个统一的目录树。 因此在长期使用，但这不是尽可能多的操作将暂时通过的状态使用单独的DAG所在的系统信息库中。<br/><br/>二）来自操作手册：<br/>###创建孤立分支<br/>&nbsp;&nbsp;&nbsp;&nbsp;git version 1.7.2+<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;# 创建<br/>&nbsp;&nbsp;&nbsp;&nbsp;git checkout --orphan &lt;newbranch&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;# 删除无用文件<br/>&nbsp;&nbsp;&nbsp;&nbsp;git rm -rf .<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;# 提交“空”内容<br/>&nbsp;&nbsp;&nbsp;&nbsp;git commit --allow-empty -m &quot;[empty] initial commit&quot;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;# 把新创建的本地分支，推送到远端仓库，保持跟踪<br/>&nbsp;&nbsp;&nbsp;&nbsp;git push -u origin &lt;newbranch&gt;<br/><br/><br/>三）实践建一个“孤立”的空分支操作如下，命令来地址（https://ihower.tw/blog/archives/5691）：<br/><textarea name="code" class="php" rows="15" cols="100">
#git clone git@gitlab.XXXXXX.com.cn:devops/docs.git
正克隆到 &#039;docs&#039;...
remote: Counting objects: 170, done.
remote: Compressing objects: 100% (152/152), done.
remote: Total 170 (delta 20), reused 160 (delta 16)
接收对象中: 100% (170/170), 38.50 MiB &#124; 138.00 KiB/s, 完成.
处理 delta 中: 100% (20/20), 完成.
检查连接... 完成

#cd docs/

#git checkout --orphan newbranch
切换到一个新分支 &#039;newbranch&#039;

#git status
位于分支 newbranch

#git rm -rf .

#git add .&nbsp;&nbsp; #cp -a /data/www/xx.xxxx.xxx/* ./&nbsp;&nbsp;#拷贝代码到当前位置。~/ansible   bjcc

#ls

#git commit -m &#039;create new branch&#039;
位于分支 newbranch
初始提交
无文件要提交


#git push
fatal: 当前分支 newbranch 没有对应的上游分支。
为推送当前分支并建立与远程上游的跟踪，使用

&nbsp;&nbsp;&nbsp;&nbsp;git push --set-upstream origin newbranch

#git push --set-upstream origin newbranch
error: src refspec newbranch does not match any.
error: 无法推送一些引用到 &#039;git@gitlab.XXXXXX.com.cn:devops/docs.git&#039;


vi&nbsp;&nbsp;README.md

#git commit -m&quot;测试一下刚建立的孤立分支&quot;
[newbranch（根提交） 754a735] 测试一下刚建立的孤立分支
 1 file changed, 1 insertion(+)
 create mode 100644 README.md


 #git push --set-upstream origin newbranch
对象计数中: 3, 完成.
写入对象中: 100% (3/3), 256 bytes &#124; 0 bytes/s, 完成.
Total 3 (delta 0), reused 0 (delta 0)
remote: 
remote: To create a merge request for newbranch, visit:
remote:&nbsp;&nbsp; http://gitlab.XXXXXX.com.cn/devops/docs/merge_requests/new?merge_request%5Bsource_branch%5D=newbranch
remote: 
To git@gitlab.XXXXXX.com.cn:devops/docs.git
 * [new branch]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newbranch -&gt; newbranch
分支 newbranch 设置为跟踪来自 origin 的远程分支 newbranch。
</textarea><br/><br/>在Gitlab的Web界面里测试一下孤立分支：<br/>newbranch&nbsp;&nbsp; Merge RequestCompare Select Archive Format<br/> 754a735a · 测试一下刚建立的孤立分支&nbsp;&nbsp;· 2 minutes ago<br/><br/>参考：https://ooso.net/archives/636
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] git孤立分支的使用情况是什么？Git 入怼之独立分支。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>