git基本使用

在github上创建仓库:
Create a new repository on the command line


touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/BrentHuang/MyRepo.git
git push -u origin master


在本地新建一个分支: git branch Branch1
切换到你的新分支: git checkout Branch1
将新分支发布在github上: git push origin Branch1
在本地删除一个分支: git branch -d Branch1
在github远程端删除一个分支: git push origin :Branch1   (分支名前的冒号代表删除)

直接使用git pull和git push的设置

git branch --set-upstream-to=origin/master master 
git branch --set-upstream-to=origin/ThirdParty ThirdParty
git config --global push.default matching



将source和master分支下的内容clone到本地即可(不需要再到官网上去clone全新的octopress),具体作法:

1)首先将博客的源文件clone到本地的hexo文件夹内。

[ruby]  view plain copy print ? 在CODE上查看代码片 派生到我的代码片
  1. $ git clone -b source git@github.com:username/username.github.com.git hexo

2)将博客文件clone到hexo_deploy文件夹内。

[ruby]  view plain copy print ? 在CODE上查看代码片 派生到我的代码片
  1. $ cd hexo
  2. $ git clone git@github.com:username/username.github.com.git _deploy   


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值