git reset --mixed
这样文件退出暂存区,但是修改保留
git submodule update --init --recursive
git reset --hard origin/develop
git fetch upstream
git checkout upstream/big/develop
git checkout -b big/develop
- 每次提交pr前进行下面操作.
git remote update upstream
git rebase upstream/{branch name}
一定要切换到到{branch name}
所指定的branch
- nginx 直接用官方 git 镜像 base,
master/develop
- 我们修改的代码按不同特性建立特性分支, 基于 develop 开 feature 分支出来(如果特性长期存在, 就需要一直维护这些分支)
- 升级 nginx 代码也单独从 develop 开分支出来, 进行兼容性升级. (其他特性分支后续开发, 反向从 develop merge 进行融合继续开发).
- 如果后续某个特性要产生 patch 直接切换到那个特性分支下, 和 nginx 某个官方 tag 版本进行 diff 就能出来.
- 特性分支也可以有 tag, 表示对应哪个 nginx 主版本, 这样方便产生不同版本对应的 patch.
首先维护的 NGINX 分支是 OpenResty 支持的最新的 NGINX 分支,目前是 release-1.9.15,从此分支 checkout 出来作为咱们要进行二次开发的主分支
目前修改的代码按特性在不同的分支上进行开发,保持特性的独立性
- merge 需要升级到的 NGINX release
- 必要时要进行单元测试
- merge 需要升级到的 NGINX release
- merge 特性分支
各项目下载主分支的代码进行编译
git reset --hard HEAD~3
GIT_COMMITTER_DATE="
date" git commit --amend --date "
date"
- refs: http://stackoverflow.com/questions/454734/how-can-one-change-the-timestamp-of-an-old-commit-in-git
- 切换到
develop
分支 - 如果本地有未提交的修改, 那么
git stash
. git br aa
git flow init
-> branch name for production releases:aa
, 后面全回车, 使用默认值.git flow feature start srs_meta
git stash pop
- do some changes
git push
- 页面上提交合并到develop分支.
- 切到在我的分支.
tig
查看我的分支有哪些我的修改. 查看有多少commitgit rebase -i HEAD~12
- 将第一行前面加r, 后面前面加f
git fetch origin -p
git rebase origin/develop
tig
我的在develop
最前git push -f
git fetch origin -p
git log
git rebase origin/develop
git rebase -i HEAD~19
git reflog
tig
git diff origin/feature/srs_meta
git diff origin/feature/srs_meta nginx/app
git push origin feature/srs_meta:feature/srs
vim ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git remote set-url origin xxx
git tag -l
显示所有tag名称git checkout tags/<tag_name>
切换到<tag_name>
git checkout -- hello.rb
- repo - Android的git多版本库管理
- Gerrit - Android的集中式管理
- Topgit - 定制开发, git相比Mercurial的优势
- git svn -
- Mercurial - go语言使用的分布式管理工具
- Gitosis
- Gitolite
- Gistore
- tig
- pySvnManager
- Freemind-MMX
- Git is at its heart very stupid simple.
- Linux Torvalds has quipped about the name "git", which is British English slang for a stupid or unpleasant person.
- I'm an egotistical bastard, and I name all my projects after myself. Fist Linux, now git.
- In many ways you can just see git as a filesystem - it's content-addressable, and it has a notion of versioning, but I really designed it coming at the problem from the viewpoint of a filesystem person(hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional SCM system.
- linux下
sha1 filename
- mac下
shasum filename
- 官网: http://www.worldhello.net/gotgit
- 微博: http://weibo.com/gotgit
- 邮件列表: http://groups.google.com/group/gotgit
- 学习分支: http://blog.likelikeslike.com/posts/2013-05-22/learn-git-branching-online-visually.html http://pcottle.github.io/learnGitBranching/
- http://gitref.org/
- http://www.liaoxuefeng.com/
- http://www.gitguys.com/?lang=zh
- http://www.gitignore.io/
- https://www.atlassian.com/git/
1. 创建~/.gitignore
2. git config --global core.excludesfile ~/.gitignore
20:12 Seveas: Akagi201: likely !newline crap
20:12 Seveas: hmm !crlf
20:12 gitinfo: to fix problems with line endings on different platforms, check out http://line-endings.gitrecipes.de/
20:12 Akagi201: thans both!
20:13 jast: unfortunately the solution outlined there really only works if you've got push access (and can make decisions about stuff like this)
20:13 Seveas: isn't there some global config you can use?
20:14 Seveas: (not on windows, so I've never had problems with this myself)
20:14 jast: another option is to stick your fingers in your ears and go "LALALALA" by doing something like 'git config core.autocrlf false'
20:14 jast: (which is the right setting anyway, IMO)
20:14 Virox: Jusat tried a merge and I got a few conflicts. One of them is "both modified: someFile.txt" I've tried git checkout --ours someFile.txt with but it's still listed there. What should I do to basically use my version?
20:15 jast: Virox: just do a 'git add' on the file to confirm you consider it resolved
20:15 Virox: I was just a bit worried about that. I'll give it a shot though
20:15 jast: if you're satisfied with what's in the file now, that is absolutely the right thing to do
20:15 jast: it's just bad if the file(s) you're adding contain garbage :)