随笔分类 - Git
摘要:$ git checkout <commit-hash> -- <filename> 在这个命令中, -- 表示参数的结束, <filename> 是要还原的文件名 例子: git checkout 070a6677af7d7b14b3ea65d4e63f5a249e3645e8 -- config
阅读全文
摘要:解决方案: 1、项目的.git文件内的目录.git/logs/refs/remotes/origin/,删除该错误的本地远程分支; 2、执行git pull --rebase即可 类似错误信息例子: fatal: bad object refs/remotes/origin/xxx fatal: b
阅读全文
摘要:在终端输入以下指令: git config --global credential.helper store然后再次执行pull操作,还是会提示一次输入帐号与密码。断开终端链接,重连,再次进行pull操作,直接就拉取代码了,不用再输入帐号密码了
阅读全文
摘要:1.修改命令 git remote set-url origin [NEW_URL] 2.先删后加 git remote rm origin git remote add origin [url]3.直接修改.git/config文件
阅读全文
摘要:git + npm link 先来看一下npm install 文档。 npm 支持安装 git 仓库,支持 git , git+ssh , git+http , git+https , or git+file 几种协议,例如: 这样会安装这个仓库的最新版本,如果需要指定版本依赖可以使用 git 的
阅读全文
摘要:1、 git clean(删除未监视文件untracked files) git clean -f # 删除 untracked files git clean -fd # 连 untracked 的目录也一起删掉 git clean -xfd # 连 gitignore 的untrack 文件/目
阅读全文
摘要:一、服务器yum -y install git git init --bare test.gitcd test.gitpwd //打印当前目录,假设是:/home/root/git/test.gitgit remote add origin ssh://(pwd)二、
阅读全文
摘要:官网英文资料:https://help.github.com/articles/connecting-to-github-with-ssh/ 1、生成SSH keys文件id_rsa.pub ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
阅读全文