图解 git
图解 git
$ git --version
# git version 2.24.3 (Apple Git-128)
$ git --help
###
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
restore Restore working tree files
rm Remove files from the working tree and from the index
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
diff Show changes between commits, commit and working tree, etc
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
grow, mark and tweak your common history
branch List, create, or delete branches
commit Record changes to the repository
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
reset Reset current HEAD to the specified state
switch Switch branches
tag Create, list, delete or verify a tag object signed with GPG
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
###
git basic
$ git status
$ git diff
$ git add .
$ git commit -m"feat: add a new ferature"
$ git pull
$ git push
$ git merge
$ git rebase
git advanced
# delete git commit history
$ git filter-branch
git filter-branch
remove git commits history
$ git clone https://github.com/xgqfrms/xgqfrms
# git checkout gh-pages
$ cd github/xgqfrms
$ git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch tools/WebStrom-2016.2.4.md" \
--prune-empty --tag-name-filter cat -- --all
# what's `\` & `""` means in git cli???
$ git filter-branch --force --index-filter "git rm --cached --ignore-unmatch tools/WebStrom-2016.2.4.md" --prune-empty --tag-name-filter cat -- --all
gif 图解 git
- git merge
- git rebase
- git reset
- git revert
- git cherry-pick
- git fetch
- git pull
- git reflog
https://dev.to/lydiahallie/cs-visualized-useful-git-commands-37p1
refs
https://www.cnblogs.com/xgqfrms/p/13338946.html
remove GitHub git commit history
https://learngitbranching.js.org/
https://github.com/pcottle/learnGitBranching
https://zhuanlan.zhihu.com/p/122474549
https://github.com/geeeeeeeeek/git-recipes/wiki
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13620471.html
未经授权禁止转载,违者必究!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2019-09-06 Intersection Observer API All In One
2019-09-06 QR code & auto login & OAuth 2.0
2018-09-06 alipay mini app
2018-09-06 bash for mac