在EclipseJava项目中,将git存储库从旧存储库更改为新存储库
我在Eclipse中有一个项目,它与Gitlab中的一个旧存储库相关联。正在使用的分支称为Test 我在Gitlab中创建了一个新的存储库(其中只有README.md文件)。它只有一个分支:大师 我需要更改Eclipse项目,使其不再引用旧存储库(和旧分支),而是引用新存储库(和主分支) 如何做到这一点 短暂性脑缺血发作 更新 @Rizwan-谢谢你提供的信息。我做了以下工作:在EclipseJava项目中,将git存储库从旧存储库更改为新存储库,eclipse,git,gitlab,Eclipse,Git,Gitlab,我在Eclipse中有一个项目,它与Gitlab中的一个旧存储库相关联。正在使用的分支称为Test 我在Gitlab中创建了一个新的存储库(其中只有README.md文件)。它只有一个分支:大师 我需要更改Eclipse项目,使其不再引用旧存储库(和旧分支),而是引用新存储库(和主分支) 如何做到这一点 短暂性脑缺血发作 更新 @Rizwan-谢谢你提供的信息。我做了以下工作: cd to the directory with the code #initialize the reposito
cd to the directory with the code
#initialize the repository
git init
#add reference to the repository I needed
git remote add origin "git@myrepo.com:WORK/<my-repository>.git"
#got what was currently in the repository
git pull origin master
#added code (not in the repository)
git add -A
#commit the code
git commit -m "first commit with code"
#sent it up
git push origin master
cd到带有代码的目录
#初始化存储库
初始化
#添加对所需存储库的引用
git远程添加源”git@myrepo.com:WORK/.git“
#已获取存储库中当前的内容
git拉源主机
#添加的代码(不在存储库中)
git添加-A
#提交代码
git commit-m“使用代码首次提交”
#送上去的
git推送源主机
我用另一条消息作为基础(但我现在找不到)
TIA这可能会有所帮助
cd/path/to/repo
git-remote-v
git远程设置url源gitlab@gitlab.mydomain:root/testproject.git
刷新/清理构建您的Eclipse项目我们可以直接在Eclipse本身中执行此操作
Goto - CurrentProject(Right Click) -> Team -> Remote -> Configure push to upstream -> Change(URI)