git 常用

本文详细介绍了如何在本地初始化Git仓库,包括创建新的仓库、推送至远程仓库的过程,以及如何使用命令行修改或设置Git的用户名和邮箱,适用于初次使用Git的开发者。

#  初始化git

…or create a new repository on the command line

 
echo "# init" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/kisstherain8231/init.git
git push -u origin master

…or push an existing repository from the command line

 
git remote add origin https://github.com/kisstherain8231/init.git
git push -u origin master

# 修改用户名称

git 修改当前的project的用户名的命令为:

> git config user.name 你的目标用户名;
1
git修改当前的project提交邮箱的命令为:

> git config user.email 你的目标邮箱名;
1
如果你要修改当前全局的用户名和邮箱时,需要在上面的两条命令中添加一个参数,–global,代表的是全局。

命令分别为:

> git config --global user.name 你的目标用户名;
1
> git config --global user.email 你的目标邮箱名;

转载于:https://www.cnblogs.com/kisstherain/p/10223930.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值