一、修改git的提交账号
1、打开安装git的文件夹,找到Git Bash,双击打开。
2、查看当前配置的账号信息 , 查看当前的用户名、邮箱
命令:
git config user.name
git config user.email
3、将用户名和邮箱替换成自己的
命令:
git config --global --replace-all user.name "自己的用户名"
git config --global --replace-all user.email "自己的邮箱"
二、拉取代码
1、直接克隆
命令:
git clone 仓库代码地址
2、新建文件夹连接远程仓库拉取,
git init
git remote add origin 仓库代码地址
git pull origin master
注意:如果用git pull 命令拉取,记得切换到master分支
git checkout master
git pull
三、提交
命令:
git add .
git commit -m '提交代码'
git push origin master
注意:提交不上去时可以试试先删除远程仓库,然后再重新连接远程仓库,之后在执行上面的命令提交
命令:
git remote rm origin
git remote add origin 仓库代码地址