Git入门(一)简易的命令行入门教程:

简易的命令行入门教程:

Git 全局设置:

git config --global user.name "NicholasYao"
git config --global user.email "414255115@qq.com"


 

创建 GIT 仓库:

mkdir TikuApp
cd TikuApp
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://git.oschina.net/youraccount/yourproject.git
git push -u origin master

克隆到本地:

<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; font-size: 15px; line-height: 19.95px; background: rgb(51, 51, 51);">git clone</pre>
</p>
 

添加所有文件到暂存区:

<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git add .</pre>
</p>
 

删除版本库的文件:

<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git rm <file></pre>
</p>

拉取到本地:

<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git pull</pre>
</p>

将本地主分支推到远程主分支:

<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git push origin master</pre>
</p>

将远程主分支合并到当前主分支:

<pre class="dark" style="box-sizing: inherit; overflow: auto; font-family: Menlo, "Liberation Mono", Consolas, "DejaVu Sans Mono", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; color: rgb(245, 245, 245); padding: 10px; line-height: 19.95px; background: rgb(51, 51, 51);">git merge origin/master</pre>
</p>

 
  
 
  
 
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值