修改现有分支推送到另一个仓库分支
# 推送zhouyishop分支到远程仓库 https://gitee.com/yyyyjinying/zhouyishop.git
git checkout zhouyishop
git remote add upstream https://gitee.com/yyyyjinying/zhouyishop.git
git pull origin zhouyishop
git branch --set-upstream-to=origin/zhouyishop zhouyishop
window连接gitee免密登录
https://blog.csdn.net/qq_33499889/article/details/104518290
简易的命令行入门教程:
Git 全局设置:
git config --global user.name “yyyyjinying”
git config --global user.email “12343343@qq.com”
创建 git 仓库:
mkdir wx-project
cd wx-project
git init
touch README.md
git add README.md
git commit -m “first commit”
git remote add origin https://gitee.com/yyyyjinying/wx-project.git
git push -u origin “master”
已有仓库
cd existing_git_repo
git remote add origin https://gitee.com/yyyyjinying/wx-project.git
git push -u origin “master”
问题
commit or discard the untracked or modified content in submodules)
状态解读:在当前文件夹内部存在其它的.git文件
解决办法:找到其它的.git文件,删除后重新 add commit
因为之前的项目有.git,后面又提交到新的仓库,出现了子模块,所有需要将多余的.git文件删除,ls -a && rm -rf .git
git更改远程仓库地址
- 查看当前远程仓库地址:使用命令git remote -v可以查看当前远程仓库的地址。
- 更改远程仓库地址:使用命令git remote set-url origin 可以将远程仓库的地址更改为新的URL。
- 验证更改是否成功:使用命令git remote -v再次查看远程仓库地址,确认更改已生效。
- 推送更改到远程仓库:使用命令git push origin master将本地仓库的更改推送到远程仓库。
- 更新本地仓库:使用命令git pull origin master可以更新本地仓库,确保与远程仓库同步。
- git push -f origin master