Git学习笔记(一)

1、git clone https://github.com/miguelgrinberg/flasky.git

cd flasky

git checkout 1a

2、git reset --hard放弃本地修改,不保存。

3、

git remote add origin git@github.com:tlikai/vimrc.git 添加远程仓库

git fetch origin

修改代码中。。。。

git push origin master 提交本地修改到远程仓库master分支

4、如果你想给别人贡献代码的话,在github上是先fork一下,然后clone到本地进行修改,然后push到自己fork的仓库中,再在github上创建一个pull request,等待作者同意并merge。

5、

1)Start development from a known tag

$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
$ cd my2.6
$ git branch my2.6.14 v2.6.14 (1)------This step and the next one could be combined into a single step with "checkout -b my2.6.14 v2.6.14".
$ git checkout my2.6.14

$git add .
$git commit

2)Delete an unneeded branch

$ git clone git://git.kernel.org/.../git.git my.git
$ cd my.git
$ git branch -d -r origin/todo origin/html origin/man (1)
$ git branch -D test (2)

1. Delete the remote-tracking branches "todo", "html" and "man". The next fetch or pull will create them again unless you configure them not to.
See git-fetch(1).
2. Delete the "test" branch even if the "master" branch (or whichever branch is currently checked out) does not have all commits from the test
branch.

 

 

 

转载于:https://www.cnblogs.com/woodyle/p/4859661.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值