git archive
just get the code without .git
git archive --format=tar --remote=git@github.xxx.com:xxxxxx.git master | tar -xf -
see more : http://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export
change author
change author info in the last commit
git commit --amend --author="your_name <your_name@email.com>"
the more : http://www.tuicool.com/articles/fQRzyaf
change remote rep
git clone a repository and push it into another repository
git remote set-url origin git@git_addr:git_repository
submodule
ref:
- https://segmentfault.com/a/1190000003076028
- https://git-scm.com/book/zh/v1/Git-%E5%B7%A5%E5%85%B7-%E5%AD%90%E6%A8%A1%E5%9D%97
clone
just clone a given branch
git clone xxxxxx -b a_branch --single-branch
log
pretty
git log -n 10 --pretty=format:"%h$%an$%cd$%s" --date=format:"%Y%m%d_%H%M%S"'
reverse
git log --reverse
oneline
git log --oneline
git-lfs
注:
- git lfs pull 可以 拉取在lfs中的所有文件
- 若checkout 某次commit, 其中没有包括lfs中文件, 侧默认不会对文件下载