赞
踩
分支名 | 功能 |
---|---|
Master | 功能完整且随时可以发布到线上进行部署的正式发布分支。基于tag进行标记,方便快速回退。 |
Hotfix | 基于master分支的fork而来,修复线上bug,快速打补丁用的。bug修复完成后,需合并到master分支和develop分支。 |
Release | 发布分支,准master分支(功能开发完了,但还有部分bug),待修复完全后合并到master分支,并打tag |
Develop | 功能的集成分支。feature新功能开发都是基于这个分支fork进行。 |
Feature | 是功能分支,从Develop分支fork而来。新功能开发完成后,合并到Develop分支。Feature分支不能直接合并到master分支上 |
# 1.修改最新commit msg git commit --amend # 2.修改历史第一条comimt msg git rebase -i --root #3.修改第一条之后的commit信息 git stash #将当前的修改用stash存储一下,后面解决完之后再释放出来 git log git rebase -i e186c75c5431a6 #这种方法只能修改第一次之后的。 -i 就是 --interactive git commit --amend #此时将有问题的提交前的pick改为edit或者reword,修改commit信息 # p, pick = use commit 使用提交(即保留它,不做修改) # r, reword = use commit, but edit the commit message 使用提交,但编辑提交的日志消息 # e, edit = use commit, but stop for amending 使用提交,但停下来修改(就是要修改提交的内容) # s, squash = use commit, but meld into previous commit 使用提交,但融入此前的提交(就是与在此之前一个提交合并) # f, fixup = like "squash", but discard this commit's log message 类似于squash,但是丢弃此提交的日志消息 # x, exec = run command (the rest of the line) using shell 运行shell命令 # d, drop = remove commit 删除提交 vim x.cpp git add x.cpp git commit --amend git rebase --continue #逐步前进到最新的提交位置 git stash pop #最后将stash存储的内容释放出来,继续工作 git push --force-with-lease origin #强制推送旧提交
git log --stat -1
git log --stat --pretty=oneline -3
git log --oneline --decorate -6 #显示引用(分支、tag等)
git log --pretty=fuller --decorate -2
git commit --amend -m "xxxx"
git commit -C C #提交说明重用C提交的提交说明。
git reflog # 引用日志:记录了HEAD、分支和标签引用的所有操作
# 很多条 git commit --amend 记录,怎么办?想删除清理干净,用下面命令:
git reflog expire --expire=now # 清理当前分支中不再活动的条目
git reflog expire --expire=now --all #清理所有分支
git gc --prune=now #清理垃圾
git tag F
git tag E HEAD^
git tag D HEAD^^
git tag C HEAD^^^
git tag B HEAD~4
git tag A HEAD~5
git tag -d tag_name #删除某tag点
git checkout tag_name #切换到某tag点
alias wget='wget --no-check-certificate'
alias gcl='git clone --recursive --recurse-submodules'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。