git 新手教程

设置git

首先需要告诉git你的身份

git config --global user.email "you@example.com"
git config --global user.name "xxxxx"

需要补充github账号注册的邮箱地址以及用户名

修改远程项目url

git remote set-url origin  https://<your_token>@github.com/<USERNAME>/<REPO>.git

提交更新

向本地仓库提交文件夹或者文件

git add <dir>
or
git add <file>

提交到远程仓库

git commit -m "<description>"
git push origin master # git push <远程仓库名>:<分支名>

将本地仓库中更新的文件提交到远程仓库,"<description>"是这一批提交的统一描述。接着推向对应的远程仓库的分支。
如果git push origin master失败,参考【突发】解决remote: Support for password authentication was removed on August 13, 2021. Please use a perso

编辑respository

换repository

git remote set-url origin URL # 更换远程仓库地址,URL为新地址

ie. git remote set-url origin git@github.com:Snowleopard-bin/scripts.git

删除现有repository

git remote rm origin

添加新的远程repository

git remote add origin url

查看远程repository

git remote -v
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值