Skip to content

Instantly share code, notes, and snippets.

@sandyxu
Last active December 21, 2015 14:08
Show Gist options
  • Save sandyxu/6317121 to your computer and use it in GitHub Desktop.
Save sandyxu/6317121 to your computer and use it in GitHub Desktop.
git, skills, expertise, config, autocomplete command
# git 命令自动提示 blog:
http://code-worrier.com/blog/autocomplete-git/
# 安装git命令自动提示后很爽,但是删除后的branch由于缓存,仍然提示出来,导致提示过多且混乱。通过查看
$ git remote show origin
* remote origin
Fetch URL: [email protected]/sandyxu/xx.git
Push URL: [email protected]/sandyxu/xx.git
HEAD branch (remote HEAD is ambiguous, may be one of the following):
master
next
Remote branches:
feature-add-apply tracked
master tracked
next tracked
refs/remotes/origin/feature-login-failure-limit stale (use 'git remote prune' to remove)
refs/remotes/origin/feature-operate-log stale (use 'git remote prune' to remove)
refs/remotes/origin/fixbug-account stale (use 'git remote prune' to remove)
Local branches configured for 'git pull':
gh-pages merges with remote gh-pages
master merges with remote master
next merges with remote next
Local refs configured for 'git push':
feature-add-apply pushes to feature-add-apply (up to date)
gh-pages pushes to gh-pages (local out of date)
master pushes to master (local out of date)
next pushes to next (up to date)
* 上面包含重要提示 stale (use 'git remote prune' to remove) *
所以运行如下命令清除即可
$ git remote prune origin
#文件名乱码问题解决
$ git config --global core.quotepath false
# Adding a remote && Tracking branch
https://help.github.com/articles/adding-a-remote
# 修改最后一次commit信息
git commit --amend -m "your new message"
# 找回丢失的文件
git rev-list -n 1 HEAD -- <file_path>
git checkout <commit>^ -- <file_path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment