惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - 是谁啊?

jenkins 权限控制(用户只能看指定的项目) NoSQLBooster for MongoDB延长-试用期 使用openVPN组建企业局域网,连接之后无法访问互联网的问题解决 - 是谁啊? mac os socks5转http proxy M1 Mac Xcode模拟器无法运行 解决git“Unable to negotiate with 218.244.143.137 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss”的问题 macos 升级后提示 python 命令需要使用命令行开发者工具,你要现在安装该工具吗 解决 Android studio 代理 Connect to 127.0.0.1:[/127.0.0.1] failed: Connection refused nginx 代理https后,应用redirect https变成http centos6无法安装nginx Postfix maillog邮件发送各阶段延时的日志记录 高德坐标系转wgs(苹果坐标系) java代码 How Do I test James Distributed Version with JMeter? springBoot项目不重新上传jar包,增量升级步骤 mac安装homebrew(国内) 企业微信会话存档消息解密(Java RSA PKCS1解密) 启动apache,将debug日志输出在console窗口 转:solr6.0配置中文分词器IK Analyzer git 忽略提交某个指定的文件(不从版本库中删除)
git pull 和本地文件冲突问题解决
是谁啊? · 2016-09-17 · via 博客园 - 是谁啊?

具体方法如下

git pull origin 分支

//出现错误

git stash  缓存起来

git pull origin 分支

git stash pop //还原

git stash clear

参考资料:

http://www.01happy.com/git-resolve-conflicts/

开发人员常常遇到这种情况:花了几天时间一直在做一个新功能,已经改了差不多十几个文件,突然有一个bug需要紧急解决,然后给一个build测试组。在Git问世之前基本上靠手动备份,费时且容易出错。

git stash命令简而言之就是帮助开发人员暂时搁置当前已做的改动,倒退到改动前的状态,进行其他的必要操作(比如发布,或者解决一个bug,或者branch,等等),之后还可以重新载入之前搁置的改动,很cool吧?

首先,用git add把所有的改动加到staging area。

git add .

接着用git stash把这些改动搁置。

git stash

到这里,当前工作平台就回复到改动之前了。该干嘛干嘛,此处省略1万字。

需要找回之前搁置的改动继续先前的工作了?

git stash apply 即可。

也可以用 git stash list 来查看所有的搁置版本(可能搁置了很多次,最好不要这样,容易搞混)

在出现一个搁置栈的情况下,比如如果你想找回栈中的第2个,可以用 git stash apply stash@{1}

如果想找回第1个,可以用 git stash pop

如果想删除一个stash,git stash drop <id>

删除所有stash,git stash clear