初识git


1,基本命令

git config [--global] user.[name,email] xxx

git init

git add file1 [file2 ... ]

git commit

git status


2,更改编辑器

git默认用nano

git config --global core.editor vim

还可以定义自己的diff工具:

git config --global merge.tool vimdiff


3,配置文件

/etc/gitconfig  :系统, 对所有用户, 使用 git config --system 来读写

~/.gitconfig :用户配置, 使用 git config --global 来读写


查看配置:

git config --list

git config user.name


4,clone

三种协议:http , git  , ssh

ssh:  git clone user@hostname:/path/to/project  newname

git:  git clone git://hostname/path/project


5, fetch

git fetch  远程仓库名


6, push

git  push 远程仓库名 本地分支名:远程分支名



99,网络资源

opengit.org

progit.org/book/

progit.org/book/zh/




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值