4.
git 修改当前的project的用户名的命令为:git config user.name 你的目标用户名;
git 修改当前的project提交邮箱的命令为:git config user.email 你的目标邮箱名;
如果你要修改当前全局的用户名和邮箱时,需要在上面的两条命令中添加一个参数,--global,代表的是全局。
命令分别为:git config --global user.name 你的目标用户名;
git config --global user.email 你的目标邮箱名;
3.git移除某些文件的追踪
先找到文件所在位置,这里要移除.idea和local.properties的追踪
右键调出git的命令
对于单个文件 使用命令:git rm --cached local.properties 对于文件夹使用:git rm -r --cached .idea/
出现如下情况表示成功
2.git 切换远程仓库地址
方法有三种:
1.修改命令
git remote set-url origin [url]
例如:Git remote set-url origin gitlab@gitlab.chumob.com:PHP/hasoffer.git
2.先删后加
git remote rm origingit remote add origin [url]
3.直接修改config文件
这三个是上找的,我只用过第一种,亲测可用
1.切换远程仓库后,需要切换用户名和密码