<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>meisw's blog</title>
		<link>http://meisw.wdlinux.cn//</link>
		<description>工作,学习,生活,这里将会有一些记录.     备用域名:http://meisw.wdlinux.cn</description>
		<copyright>Copyright (C) 2004 Security Angel Team [S4T] All Rights Reserved.</copyright>
		<generator>SaBlog-X Version 1.6 Build 20080806</generator>
		<lastBuildDate>Tue, 29 Sep 2026 10:29:49 +0000</lastBuildDate>
		<ttl>30</ttl>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1070-1.html</guid>
			<title>gitignore 不起作用的解决办法</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;git rm -r --cached .</p>
<div>git add .</div>
<div>git commit -m 'update .gitignore'</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1070-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-51-1.html">github</category>
			<pubDate>2019-01-25 14:18</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1069-1.html</guid>
			<title>git用户密码</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;</p>
<div>&nbsp;</div>
<div>git</div>
<div>SSL Error: unable to get local issuer certificate</div>
<div>git config --global http.sslVerify false</div>
<div>&nbsp;</div>
<div>git http\https\git免密设置记住用户名和密码的方法</div>
<div>设置记住密码（默认15分钟）：</div>
<div>git config --global credential.helper cache</div>
<div>如果想自己设置时间，可以这样做：</div>
<div>git config credential.helper 'cache --timeout=3600'</div>
<div>这样就设置一个小时之后失效</div>
<div>长期存储密码：</div>
<div>git config --global credential.helper store</div>
<div>增加远程地址的时候带上密码也是可以的。(推荐)</div>
<div>http://yourname:password@git.oschina.net/name/project.git</div>
<div>补充：使用客户端也可以存储密码的。</div>
<div>如果你正在使用ssh而且想体验https带来的高速，那么你可以这样做： 切换到项目目录下 ：</div>
<div>cd projectfile/</div>
<div>移除远程ssh方式的仓库地址</div>
<div>git remote rm origin</div>
<div>增加https远程仓库地址</div>
<div>git remote add origin http://yourname:password@git.oschina.net/name/project.git</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1069-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-51-1.html">github</category>
			<pubDate>2019-01-25 09:39</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1068-1.html</guid>
			<title>git常见问题</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span style="color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">问题</span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">报错：error: The requested URL returned error: 401 Unauthorized while accessing<br style="margin: 0px; padding: 0px;" />
git版本：1.7.1</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">解决方法一：指定用户<br style="margin: 0px; padding: 0px;" />
git clone https://github.com/org/project.git</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">换成<br style="margin: 0px; padding: 0px;" />
git clone https://username@github.com/org/project.git<br style="margin: 0px; padding: 0px;" />
或者<br style="margin: 0px; padding: 0px;" />
git clone https://username:password@github.com/org/project.git</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">在push或者pull出出现的话，则需要更改远程地址<br style="margin: 0px; padding: 0px;" />
git remote set-url origin https://username@github.com/org/project.git</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">解决方法二：去除验证<br style="margin: 0px; padding: 0px;" />
git config &ndash;global http.sslverify false</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">解决方法三：（推荐）<br style="margin: 0px; padding: 0px;" />
升级git 版本&ge;1.7.10</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">解决方法四：<br style="margin: 0px; padding: 0px;" />
添加ssh秘钥</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">&nbsp;</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif;">--------------</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">刚创建的github版本库，在push代码时出错：</p>
<div style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; overflow-wrap: break-word;">$ git push -u origin master To git@github.com:******/Demo.git  ! [rejected]        master -&gt; master (non-fast-forward) error: failed to push some refs to 'git@github.com:******/Demo.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.</pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">网上搜索了下，是因为远程<span style="line-height: 19.5px;">repository和我本地的<span style="line-height: 19.5px;">repository冲突导致的，而我在创建版本库后，在github的版本库页面点击了创建README.md文件的按钮创建了说明文档，但是却没有pull到本地。这样就产生了版本冲突的问题。</span></span></p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">有如下几种解决方法：</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">1.使用强制push的方法：</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;"><span style="line-height: 19.5px;">$ git push -u origin master -f&nbsp;</span></p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">这样会使远程修改丢失，一般是不可取的，尤其是多人协作开发的时候。</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">2.push前先将远程repository修改pull下来</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">$&nbsp;<span style="line-height: 19.5px;">git pull origin master</span></p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;"><span style="line-height: 19.5px;">$ git push -u origin master</span></p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">3.若不想merge远程和本地修改，可以先创建新的分支：</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">$&nbsp;<span style="line-height: 19.5px;">git branch [name]</span></p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">然后push</p>
<p style="margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;">$&nbsp;<span style="line-height: 19.5px;">git push -u origin [name]</span></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1068-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-51-1.html">github</category>
			<pubDate>2019-01-24 18:02</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-976-1.html</guid>
			<title>git使用说明</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;git reset --hard HEAD^^</p>
<div>&nbsp;</div>
<div>git checkout -b v3</div>
<div>&nbsp;</div>
<div>git branch origin/master</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>.gitconfig 文件中添加</div>
<div>&nbsp;</div>
<div>[credential]</div>
<div>&nbsp; &nbsp; helper = store</div>
<div>&nbsp;</div>
<div>git config credential.helper 'cache &ndash;timeout=3600'</div>
<div>git config &ndash;global credential.helper store</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>git remote -v</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>git init</div>
<div>&nbsp;</div>
<div>git remote add origin https://gitee.com/wdlinux/lanmp.git</div>
<div>&nbsp;</div>
<div>把本地库的内容推送到远程，使用 git push命令，实际上是把当前分支master推送到远程。</div>
<div>&nbsp;</div>
<div>由于远程库是空的，我们第一次推送master分支时，加上了 &ndash;u参数，Git不但会把本地的master分支内容推送的远程新的master分支，还会把本地的master分支和远程的master分支关联起来，在以后的推送或者拉取时就可以简化命令。推送成功后，可以立刻在github页面中看到远程库的内容已经和本地一模一样了，上面的要输入github的用户名和密码如下所示：</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>git checkout 命令加上 &ndash;b参数表示创建并切换，相当于如下2条命令</div>
<div>git branch dev</div>
<div>git checkout dev</div>
<div>git branch查看分支，会列出所有的分支，当前分支前面会添加一个星号。</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>现在我们可以把dev分支上的内容合并到分支master上了，可以在master分支上，使用如下命令 git merge dev 如下所示：</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>总结创建与合并分支命令如下：</div>
<div>&nbsp; &nbsp;查看分支：git branch</div>
<div>&nbsp; &nbsp;创建分支：git branch name</div>
<div>&nbsp; &nbsp;切换分支：git checkout name</div>
<div>创建+切换分支：git checkout &ndash;b name</div>
<div>合并某分支到当前分支：git merge name</div>
<div>删除分支：git branch &ndash;d name</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>3.分支管理策略。</div>
<div>&nbsp; &nbsp; &nbsp; 通常合并分支时，git一般使用&rdquo;Fast forward&rdquo;模式，在这种模式下，删除分支后，会丢掉分支信息，现在我们来使用带参数 &ndash;no-ff来禁用&rdquo;Fast forward&rdquo;模式。首先我们来做demo演示下：</div>
<div>&nbsp;</div>
<div>创建一个dev分支。</div>
<div>修改readme.txt内容。</div>
<div>添加到暂存区。</div>
<div>切换回主分支(master)。</div>
<div>合并dev分支，使用命令 git merge &ndash;no-ff &nbsp;-m &ldquo;注释&rdquo; dev</div>
<div>查看历史记录</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Git基本常用命令如下：</div>
<div>&nbsp; &nbsp;mkdir： &nbsp; &nbsp; &nbsp; &nbsp; XX (创建一个空目录 XX指目录名)</div>
<div>&nbsp; &nbsp;pwd： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;显示当前目录的路径。</div>
<div>&nbsp; &nbsp;git init &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;把当前的目录变成可以管理的git仓库，生成隐藏.git文件。</div>
<div>&nbsp; &nbsp;git add XX &nbsp; &nbsp; &nbsp; 把xx文件添加到暂存区去。</div>
<div>&nbsp; &nbsp;git commit &ndash;m &ldquo;XX&rdquo; &nbsp;提交文件 &ndash;m 后面的是注释。</div>
<div>&nbsp; &nbsp;git status &nbsp; &nbsp; &nbsp; &nbsp;查看仓库状态</div>
<div>&nbsp; &nbsp;git diff &nbsp;XX &nbsp; &nbsp; &nbsp;查看XX文件修改了那些内容</div>
<div>&nbsp; &nbsp;git log &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;查看历史记录</div>
<div>&nbsp; &nbsp;git reset &nbsp;&ndash;hard HEAD^ 或者 git reset &nbsp;&ndash;hard HEAD~ 回退到上一个版本</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (如果想回退到100个版本，使用git reset &ndash;hard HEAD~100 )</div>
<div>&nbsp; &nbsp;cat XX &nbsp; &nbsp; &nbsp; &nbsp; 查看XX文件内容</div>
<div>&nbsp; &nbsp;git reflog &nbsp; &nbsp; &nbsp; 查看历史记录的版本号id</div>
<div>&nbsp; &nbsp;git checkout &mdash; XX &nbsp;把XX文件在工作区的修改全部撤销。</div>
<div>&nbsp; &nbsp;git rm XX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;删除XX文件</div>
<div>&nbsp; &nbsp;git remote add origin https://github.com/tugenhua0707/testgit 关联一个远程库</div>
<div>&nbsp; &nbsp;git push &ndash;u(第一次要用-u 以后不需要) origin master 把当前master分支推送到远程库</div>
<div>&nbsp; &nbsp;git clone https://github.com/tugenhua0707/testgit &nbsp;从远程库中克隆</div>
<div>&nbsp; &nbsp;git checkout &ndash;b dev &nbsp;创建dev分支 并切换到dev分支上</div>
<div>&nbsp; &nbsp;git branch &nbsp;查看当前所有的分支</div>
<div>&nbsp; &nbsp;git checkout master 切换回master分支</div>
<div>&nbsp; &nbsp;git merge dev &nbsp; &nbsp;在当前的分支上合并dev分支</div>
<div>&nbsp; &nbsp;git branch &ndash;d dev 删除dev分支</div>
<div>&nbsp; &nbsp;git branch name &nbsp;创建分支</div>
<div>&nbsp; &nbsp;git stash 把当前的工作隐藏起来 等以后恢复现场后继续工作</div>
<div>&nbsp; &nbsp;git stash list 查看所有被隐藏的文件列表</div>
<div>&nbsp; &nbsp;git stash apply 恢复被隐藏的文件，但是内容不删除</div>
<div>&nbsp; &nbsp;git stash drop 删除文件</div>
<div>&nbsp; &nbsp;git stash pop 恢复文件的同时 也删除文件</div>
<div>&nbsp; &nbsp;git remote 查看远程库的信息</div>
<div>&nbsp; &nbsp;git remote &ndash;v 查看远程库的详细信息</div>
<div>&nbsp; &nbsp;git push origin master &nbsp;Git会把master分支推送到远程库对应的远程分支上</div>
<div>&nbsp;</div>
<div>http://blog.jobbole.com/78960/</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-976-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-51-1.html">github</category>
			<pubDate>2017-10-21 16:12</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-877-1.html</guid>
			<title>git代理设置</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;">问题：</span></p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;">E:\PDFium&gt;git clone https://pdfium.googlesource.com/pdfium<br />
Cloning into 'pdfium'...<br />
fatal: unable to access 'https://pdfium.googlesource.com/pdfium/': Failed connect to pdfium.googlesource.com:443; No error</p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;">解决：</p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;">git config --global http.proxy http://proxy.com:1234</p>
<p><span style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;">git config --global https.proxy http://proxy.com:1234</span><br style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;" />
<span style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;">git config --global http.sslverify false</span></p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;"><span style="font-size: 15px; vertical-align: baseline; background-color: transparent;">转自：http://ricksu.blog.163.com/blog/static/18906433820125294929508/</span></p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;"><span style="font-size: 15px; vertical-align: baseline; background-color: transparent;">参考：http://infong.net/config-proxy-for-git/<br />
</span></p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;"><span style="color: rgb(102, 102, 102); font-size: 15px; vertical-align: baseline; background-color: transparent;"><span style="color: rgb(0, 0, 0);">我使用本机上的小软件翻墙，所以设置为</span></span></p>
<p style="color: rgb(51, 51, 51); font-family: Arial; line-height: 26px;"><span style="color: rgb(102, 102, 102); font-size: 15px; vertical-align: baseline; background-color: transparent;">E:\PDFium&gt;git config --global http.proxy http://127.0.0.1:8580<br />
E:\PDFium&gt;git config --global https.proxy https://127.0.0.1:8580<br />
E:\PDFium&gt;git config --global http.SSLVERIFY false</span></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-877-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-51-1.html">github</category>
			<pubDate>2016-12-15 18:12</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-848-1.html</guid>
			<title>docker_practice</title>
			<author>admin</author>
			<description><![CDATA[<p><a href="https://github.com/yeasy/docker_practice">&nbsp;https://github.com/yeasy/docker_practice</a></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-848-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-51-1.html">github</category>
			<pubDate>2016-12-07 23:33</pubDate>
		</item>
	</channel>
</rss>
