设置用户信息
$ git config --global user.name itaken $ git config --global user.email regelhh@gmail.com
git 别名
$ git config --global alias.br branch $ git config --global alias.ci commit $ git config --global alias.st status
仓库状态
$ git st -s M src/views/index.vue A src/views/login.vue A src/views/profile.vue A src/views/sidebar.vue ...
删除(取消)提交内容,并保留本地文件
$ git rm -rf node_modules --cache
-r 目录循环 -f 强制删除
.gitignore
忽略列表 ^1$ cat .gitignore node_modules/
提交的”补丁”
$ git commit -m "版本内容" $ git add someting $ git commit --amend
--amend
这个会将本次commit的内容补齐到上一次commit中修改远程url
set-url
hexo_tech_wiki ‹master*› $ git remote -v 1 ↵ origin http://localhost:3000/itaken/hexo_tech_wiki.git (fetch) origin http://localhost:3000/itaken/hexo_tech_wiki.git (push) hexo_tech_wiki ‹master*› $ git remote set-url origin http://localhost:3001/itaken/hexo_tech_wiki.git hexo_tech_wiki ‹master*› $ git remote -v origin http://localhost:3001/itaken/hexo_tech_wiki.git (fetch) origin http://localhost:3001/itaken/hexo_tech_wiki.git (push)
Previous

2017-04-03
Next

2017-04-01