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

推荐订阅源

量子位
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
C
Cybersecurity and Infrastructure Security Agency CISA
Engineering at Meta
Engineering at Meta
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
T
Threat Research - Cisco Blogs
C
Cisco Blogs
Recent Announcements
Recent Announcements
S
Securelist
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
P
Privacy & Cybersecurity Law Blog
宝玉的分享
宝玉的分享
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
月光博客
月光博客
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LINUX DO - 最新话题
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
H
Help Net Security
Spread Privacy
Spread Privacy
PCI Perspectives
PCI Perspectives
Project Zero
Project Zero
I
Intezer
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
The Last Watchdog
The Last Watchdog
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
B
Blog RSS Feed
MyScale Blog
MyScale Blog
V
Vulnerabilities – Threatpost
Recorded Future
Recorded Future
T
Tenable Blog
Jina AI
Jina AI
D
DataBreaches.Net
阮一峰的网络日志
阮一峰的网络日志

Lynx

Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方 Lynx | 小熊写字的地方
Lynx | 小熊写字的地方
2019-03-12 · via Lynx

合并远程分支

  1. git fetch origin branch
  2. git checkout [your-branch]
  3. git merge FETCH_HEAD,merge 前可以先git dff [your-branch] [remote-branch],查看本地分支和远程分支的区别

使用 rebase 合并分支

  1. git rebase [origin-branch]
  2. 遇到冲突,解决完冲突后 git add
  3. git rebase –continue

rebase 和 merge 的区别

合并历史commit

git rebase -i [commit id] commit id是合并的提交的前一个提交节点的commitID,最上的是最早的提交
修改需要合并的commit,将pick修改成 squash
退出保存 wq
git push origin [branch-name] -f
rebase 的主要用途一是替代merge,保持分支历史的线性提交;二是方便合并历史提交。

撤销一次merge

  1. git reflog 确定回滚的commit id
  2. git reset –hard [commit id]

git revert 也可以回退到指定版本,和reset的区别在于,revert会产生一次新的提交,用一次新的提交来消除历史修改。而reset是直接删除历史commit。

合并时遇到冲突,想取消merge

git merge –abort

修改最后一次提交的commit message

git commit –amend

清空工作区的修改

git checkout .

恢复误删分支

  1. git log -g 找到之前分支提交的 commit id
  2. git branch recover_branch [commit id],这时切换到 recover_branch,可以看到原来的文件了。

修改历史提交信息

  1. git rebase -i HEAD~10(查看前10次提交信息,也可以直接输入想要修改的commit id)
  2. 将想要的修改的commit前的 pick 修改为 reword,保存并退出。
  3. 在弹出的窗口中,修改commit message,保存。

删除历史提交

  1. 用 git rebase -i 928582641a 指定 base 为你需要删除的提交的前一个提交。
  2. 删除指定的commit, 保存退出. 之后可能 git 会提示出现 conflict, 根据提示完成处理。

创建空白分支

  1. git checkout –orphan new_branch
  2. git rm -rf .

查看本地分支和远程分支的差异

  1. git fetch origin
  2. git diff master origin/master –minimal

建立远程追踪分支

git branch -u [remote_branch]

删除远程分支

  1. git branch -r -d origin/branch-name
  2. git push origin :branch-name