git
Coding_Ape
这个作者很懒,什么都没留下…
展开
-
package.json文件中的^和~的区别
参考文章:http://fredkschott.com/post/2014/02/npm-no-longer-defaults-to-tildes/总结:~(tilde):将会匹配最近的小版本,即 ~1.2.3会匹配区域内 [1.2.3, 1.3.0) 的版本^(caret):将会匹配最近的主要版本,即 ^1.2.3会匹配区域内 [1.2.3, 2.0.0)原创 2017-11-02 13:38:37 · 931 阅读 · 0 评论 -
删除指定编号的stash内容
git stash drop -q stash@{2} 删除指定编号为2的stash内容原创 2017-11-02 14:56:44 · 3755 阅读 · 0 评论 -
回滚到历史版本后,找回未push的commit
事件背景:local比remote仓库多一个commit,但因为调试需求将local代码回滚到了某历史版本,调试完后,想要回到local的最新代码,但git log后没找到比remote多的那个commit版本号解决办法:通过git reflog可以查看命令历史,里边记录着本地commit的版本号,运行git reset --hard (版本号)就可以回退到local比remote多一个commi...原创 2017-10-25 12:55:15 · 670 阅读 · 0 评论 -
Git常用命令总结
对于本地仓库,可以分为工作目录、缓存区(index)、HEAD三部分。远程仓库就是github网站上的代码仓库。git add 命令会将当前修改保存到indexgit commit 命令会将当前修改保存到HEADgit push 命令会将当前修改保存到远程仓库普通git用户使用常见操作:echo “filename” > .gitignore 不将filename文件夹内容提交到远...原创 2016-09-08 11:39:34 · 296 阅读 · 0 评论