美文网首页
Git 常用命令

Git 常用命令

作者: 超能_ | 来源:发表于2020-01-02 22:43 被阅读0次

初始化仓库

  • 新建一个文件夹
mkdir afolder
cd afolder
  • 初始化仓库
afolder> git init .

远程仓库

这个命令就是给远程仓库地址起一个名字,方便以后使用
比如说,我的仓库的地址是

https://github.com/hyperpower/CarpioPlus.git

在本地文件夹中

afolder> git remote add carpio https://github.com/hyperpower/CarpioPlus.git

carpio 就是自己给的仓库的名字,可以用

afolder> git remote -v

查看已有的名字

gh-pages 分支的提交

  • 删除原有的文件
git clean -fdx  #删除没有track的文件
git rm -rf .       #删除所有文件
  • 把新的文件copy过来
  • 提交到gh-pages 分支
git checkout gh-pages   #切换到gh-pages 分支
git add *
git commit -m "message"
git push carpio master

相关文章

网友评论

      本文标题:Git 常用命令

      本文链接:https://www.haomeiwen.com/subject/gvdaoctx.html