<?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[[实践OK] Git pull 强制覆盖本地文件：git 放弃本地修改 强制更新,git本地有修改如何强制更新, git reset --hard origin/master, Git Your branch is ahead of origin/master by X commits也可用。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[版本控制]]></category>
<pubDate>Thu, 22 Jun 2017 16:07:11 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：在windows下提交了一个git更新，想在linux下强制更新（这个linux下的文件也被我改动了），以windows下提交的为准怎么办？还会出错，如下：<br/>Git pull 强制覆盖本地文件，与在git bash下实践OK，AddTime：2016-9-29<br/><br/>git fetch --all&nbsp;&nbsp;<br/>git reset --hard origin/master <br/>git pull<br/><br/><br/>git reset --hard origin/xiangdong<br/><br/>来自：http://blog.csdn.net/baple/article/details/49872765<br/><br/>main分支：<br/><textarea name="code" class="php" rows="15" cols="100">
git reset --hard origin/main
HEAD is now at f821010 提交编译通过后的代码到Git仓库，包括bin目录下面的二进制可执行文件。
git pull
Already up to date.
git status
On branch main
Your branch is up to date with &#039;origin/main&#039;.
git status
On branch main
Your branch is up to date with &#039;origin/main&#039;.
nothing to commit, working tree clean
</textarea><br/><br/>一）出错：<br/>新增文件add commit后，push回原分支失败，报错：<br/>&nbsp;&nbsp;Counting objects: 20, done.<br/>&nbsp;&nbsp;Delta compression using up to 24 threads.<br/>&nbsp;&nbsp;Compressing objects: 100% (11/11), done.<br/>&nbsp;&nbsp;Writing objects: 100% (11/11), 1.30 KiB, done.<br/>&nbsp;&nbsp;Total 11 (delta 5), reused 0 (delta 0)<br/>&nbsp;&nbsp;error: insufficient permission for adding an object to repository database ./objects<br/><br/><br/>二）git本地有修改如何强制更新到远程：<br/>本地有修改和提交，如何强制用远程的库更新更新。我尝试过用git pull -f，总是提示 You have not concluded your merge. (MERGE_HEAD exists)。<br/>我需要放弃本地的修改，用远程的库的内容就可以，应该如何做？傻傻地办法就是用心的目录重新clone一个，正确的做法是什么？<br/><br/>正确的做法应该是：<br/>git fetch --all<br/>git reset --hard origin/master<br/>git fetch 只是下载远程的库的内容，不做任何的合并git reset 把HEAD指向刚刚下载的最新的版本<br/><br/>参考链接：<br/><br/>http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK] Git pull 强制覆盖本地文件：git 放弃本地修改 强制更新,git本地有修改如何强制更新, git reset --hard origin/master, Git Your branch is ahead of origin/master by X commits也可用。]]></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>