关于git上传代码到GitHub的一些东西!

git上传代码到GitHub的步骤:

1.g it init
2.git add .
3.git git commit -m "注释语句"
4.git remote add origin git地址
5. git pull origin master
6.git push -u origin master

如果push出现403,两种解决办法:
1.修改.git文件夹里面config的配置。
[remote "origin"]
url = https://github.com/ecChain/go-ecchain.git
fetch = +refs/heads/*:refs/remotes/origin/*
修改为
[remote "origin"]
url = https://[email protected]/ecChain/go-ecchain.git
fetch = +refs/heads/*:refs/remotes/origin/*


2.如果是再不同的GitHub账号下操作的话,除了上面这一步骤,可能还需要修改计算机配置
》》控制面板\用户帐户和家庭安全\凭据管理器》修改普通凭据里面GitHub的用户名和密码为你当前的用户名和密码

如果需要修改git用户名或者用户邮箱,操作如下:
git config user.name/email 查看当前git用户名/邮箱
git config --global user.name/email "新的用户名/email"

猜你喜欢

转载自www.cnblogs.com/aotuboke/p/9227879.html
今日推荐