答:
git log --oneline|wc -l
答:
- 删除本地分支:git branch -D foo
- 删除远端分支:git push origin :foo
答:
git config --global core.editor vim
答:
git remote prune origin
答:
git push --tags
答:
git checkout -
答:
git cherry-pick $sha1
答:
使用对方的:git checkout --theirs YOUR_BINARY_FILE
使用自己的:git checkout --ours YOUR_BINARY_FILE
如果都不行那就重新做了。。。
答:
两种方式:
git diff --stat [$sha1] [$sha1]git diff --name-status [$sha1] [$sha1]
答:
git branch -m <old branch name> <new branch name>
答:
新仓库:
git clone --recursive git://github.com/foo/bar.git
已克隆主库:
git clone git://github.com/foo/bar.git
cd bar
git submodule update --init --recursive
答:
本地删除:
git tag -d [tagname]
远端删除:
git push [remote] :refs/tags/[tagname]
答:
git rev-parse HEAD
答:
git默认会对路径里超过0x80的字节进行转码,设置core.quotepath为fasle可以禁止自动转码,详情见git-config(1)的core.quotepath部分。解决办法是:
git config --global core.quotepath false
答:
查看:
cat .git/config
设置: # 仅设置上游 git branch --set-upstream-to origin/master
# 推送的同时设置上游
git push -u origin master
描述:
有个文件a.php,执行git rm a.php时是正常的,但是一提交就报Could not open input file:a.php。
办法:
git rm a.php
touch a.php
git commit -am 'delete a.php'
git tag -f {new_name} {old_name}
git tag -d {old_name}
git push origin :refs/tags/{old_name}
git commit --allow-empty -m 'empty commit'
git commit --amend --author="Author Name <email@address.com>" --no-edit