git
前端攻城狮宇凡
这个作者很懒,什么都没留下…
展开
-
GIT:合并多个提交
git rebase -i HEAD~2将第二个 pick 改为 s , 代表合并到上一个提交,:wq保存将两条提交信息改为一条git push -f, 强制推送原创 2020-06-29 18:33:24 · 179 阅读 · 0 评论 -
GIT:reflog恢复代码、分支操作
分支查看分支:git branch创建分支xxx:git branch xxx切换分支:git checkout xxx创建并切换分支:git checkout -b xxx推送分支:git checkout origin xxx恢复记录一次失误在本地修改代码commit后push失败,以为在错误的分支,于是来回切换了分支,发现修改后的代码没了 - -|| 且不知道还做了什么操作,git log里没有提交记录了,最后使用git reflog进行了恢复。git reflog:显示从克隆仓库开原创 2020-05-25 10:53:54 · 2316 阅读 · 0 评论 -
GIT:A仓库迁移至空的B仓库
A仓库迁移至空的B仓库进入A仓库:添加新的不重复的远程仓库名git remote add 名字,成功后可通过git remote 查看给仓库名设置对应的地址git remote set-url B仓库地址正常推送git add .git commit -m "--transfer--"git push 刚刚添加的名字...原创 2019-12-27 09:49:01 · 430 阅读 · 0 评论 -
GIT:git commit -m ‘first commit‘报错
git commit -m 'first commit’报错:vue终端中使用git commit -m 'first commit'报错:error: pathspec 'commit'' did not match any file(s) known to git原因:。。单引号改为双引号。git commit -m "first commit"...原创 2019-12-26 11:00:12 · 2487 阅读 · 1 评论 -
GIT:本地项目上传到空远程仓库
本地项目上传到空的远程仓库:git remote add origin 地址git initgit add .git commit -m "xxx"git push origin master原创 2019-12-26 16:59:09 · 1534 阅读 · 0 评论