Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git小记 #3

Open
polunzh opened this issue Jan 23, 2017 · 0 comments
Open

git小记 #3

polunzh opened this issue Jan 23, 2017 · 0 comments

Comments

@polunzh
Copy link
Owner

polunzh commented Jan 23, 2017

git小记


命令:

配置命令别名:

git config --system alias.{short name} {origin name}

列出所有别名配置:

git config --get-regexp alias

打标签:

  • 轻量级标签 git tag {tagname}
  • 含附注标签 git tag -a {tagname} -m {annotation}
  • 推送分支 git push origin {tagname}
  • 推送所有分支 git push origin --tags

重命名分支:

  • 命名任何一个分支 git branch -m {oldname} {newname}
  • 命名当前分支 git branch -m {newname}

删除文件:

  • 从仓库中以及从文件系统中删除文件: git rm {file name}
  • 仅从仓库中删除文件: git rm --cached {file name}

删除远程不存在的本地分支引用:

git fetch -p

合并最近n次提交:

git rebase --interactive HEAD~n
http://stackoverflow.com/questions/2563632/how-can-i-merge-two-commits-into-one

配置相关

  • 列出所有别名: git config --get-regexp alias

问题

  1. git status 乱码 git config --global core.quotepath false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant