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

Example Usage

注:

  • git lfs pull 可以 拉取在lfs中的所有文件
  • 若checkout 某次commit, 其中没有包括lfs中文件, 侧默认不会对文件下载
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐