git
git clone git@git.coding.net:daydaygo/project.git # sshgit clone http://git.coding.net/daydaygo/project.git # httpgit config --global credential.helper store# 获取远程分支git fetchgit checkout xxx# 新增远程仓库git remote add urlgit push -u origin matergit push# 修改远程仓库git remote set-url origin git://new.url.here# git pull 冲突git stashgit pullgit stash popgit checkout . # 取消所有临时修改# 增加 taggit pullgit taggit tag -a xxx -m 'xxx'git push --tagsgit show [十六进制码] # 显示某一个特定的提交的日志git log --graph --pretty=oneline --abbrev-commit # 查看提交图git ls-files -u # 查看冲突未处理的文件列表# 子模块 submodule -> 最好不用,别增加复杂度了git submodule add https://github.com/chaconinc/DbConnector # addgit clone xxx # 原项目git submodule initgit submodule update# pull requestsfork # github 上 fork 别人的代码库git clone myself/xxxgit remote add upstream origin/xxx # 取名为 upstream 和 origin 一样,习惯而已git remote -vgit checkout -b feature-xxx # 新建分支进行修改git pull upstream master # 切回 master 后获取上游代码git rebase master # 切回 feature 分支,将 feature 上的提交至于 master 分支上的提交之上git push origin feature-xxx # 提交自己分支到 github 上,这样就可以在 github 上看到 compare & pull request# 代码回滚 -> 方法不好用git log # 查看 commit idgit reset --hard e377f60e28c8b84158 # 回滚到指定的版本git push -f origin master # 使用这个版本替换当前版本并推送到远程分支# git reset --hard 会丢失回滚这段期间的 commit冲突: 将每次commit用线串起来, 不同分支上面的commit就可能将直线分为2个, 当合并这2个分支就可能遇到冲突; 解决冲突实际就是修改发生冲突的文件, 修改完之后再提交一次, 这次用来合并的分支和正在使用的分支, 都将指向新的commit
标签: 对外是软件发布的版本;对内实际是指向某个commit点的指针
pull request: 你自己的项目, 怎么折腾都行, 如果想贡献代码给他人的项目, 就需要先fork版本到自己的github, 折腾完了发起一个pull request 请求
issue: 大部分都是 bug,也有部分关于软件的改进