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

推荐订阅源

Latest news
Latest news
T
Troy Hunt's Blog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
V
V2EX
博客园 - 司徒正美
B
Blog RSS Feed
AWS News Blog
AWS News Blog
MyScale Blog
MyScale Blog
Scott Helme
Scott Helme
Cisco Talos Blog
Cisco Talos Blog
Last Week in AI
Last Week in AI
NISL@THU
NISL@THU
博客园 - Franky
P
Proofpoint News Feed
博客园_首页
C
CERT Recently Published Vulnerability Notes
雷峰网
雷峰网
S
Schneier on Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
WordPress大学
WordPress大学
The Hacker News
The Hacker News
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Microsoft Azure Blog
Microsoft Azure Blog
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
罗磊的独立博客
T
The Blog of Author Tim Ferriss
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
Intezer
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
K
Kaspersky official blog
SecWiki News
SecWiki News
云风的 BLOG
云风的 BLOG
美团技术团队
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Security Latest
Security Latest
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog
S
Security Affairs

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