网络营销品牌推广公司哪家好,seo见到效果再付费,深圳app开发公司有哪些,全媒体广告投放平台导言
如果你是新手小白#xff0c;完全不懂git#xff0c;可以先看这一篇 github 详细教程 本文仅适用于对 git 操作已经有了一定掌握的用户#xff0c;本文的目的在于将常用命令统一梳理记录#xff0c;便于查阅。 干货
克隆指定分支#xff1a;git clone -b branc…导言
如果你是新手小白完全不懂git可以先看这一篇 github 详细教程 本文仅适用于对 git 操作已经有了一定掌握的用户本文的目的在于将常用命令统一梳理记录便于查阅。 干货
克隆指定分支git clone -b branch_name git_repo_linkgit add的反操作git reset HEAD [文件名, optional]git commit的反操作 恢复到暂存区 git reset --soft HEAD^直接丢弃commit的修改git reset --hard HEAD^ 本地覆盖远程git push origin -f远程覆盖本地git reset --hard origin/master git pull拉取所有更新但不同步git fetch --all分支branch 创建分支git checkout -b new_branch [old_branch, optional,默认是当前分支]删除分支git branch -d(or -D,强制删除) branch_name删除远程分支git push --delete origin branch_name修改分支名git branch -m old_name new_name 标签tagtag其实也是一个 branch 创建 taggit tag tag_name查看 tag 列表git tag查看 tag 列表有过滤条件git tag -l “0.1.0*” 只查看0.1.0开头的tag删除 taggit tag -d tag_name将 tag 同步到远程git push origin tag_name git stash相关 将修改暂存git stash将修改释放git stash pop查看暂存的修改git stash list git merge git rebase 相关假定我们现在在一个从master checkout 出来的 feature 分支上https://joyohub.com/2020/04/06/git-rebase/ git merge master会在feature 分支的顶端新建个merge commit将两个分支的修改merge在一起 优点非破坏性缺点创建了新的merge 节点会使feature分支的历史记录变的复杂,尤其是如果master更新频繁的话会把feature的提交记录搞的很脏 只merge特定的几个commitcherry pick 只将master里的某个commit 合到 feature 里面来git cherry-pick commit_id of master将master里的某一段commit合到 feature 里面来git cherry-pick start_commit_id…end_commit_id 左开右闭不包含start_commit_id git rebase master将 feature分支的改动移动到master分支的顶端不会创建新commit 优点项目历史很清晰消除了git merge 所需的不必要的合并节点缺点虽然提交历史记录“看起来”是干净整洁的其实可能会有合并错的风险 git rebase 合并多次提交记录 git rebase -i HEAD~4 进入vi编辑模式在编辑模式里修改哪些commit需要被合并哪些需要保留pick保留squash和前一个commit合并drop删除该commit git merge 和 git rebase 过程中的 incoming和current branch 分别是什么 git mergeMerge the incoming changes into the current branchgit rebaseRebase the current branch on top of the incoming changes