简体   繁体   中英

Xcode push workspace with submodules wrong repository on push

I am trying to cleanup my workspace. I've created a separate reusable static library for the helper functions and another for the main project.

My directory structure is as follows:

SimplyStats/
    SimplyStats/
    externals/GoodStuffIOS

both the main project and the library project have been succesfully pushed/updated/committed to their respective bitBucket repositories.

But when i use XCode to push changes, i get the following dialog:

源代码控制推对话框

Notice that the Remote repository for the GoodStuffIOS project is at fault. The repository Organiser shows that the repositories are set up correctly. Whatever I do, I cannot fix that remote. How do I fix this?

EDIT: Here are the contents of my .git/config (starred the repo names)

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = false
[branch "master"]
[remote "SimplyStats"]
    url = https://************@bitbucket.org/**********/simplystats
    fetch = +refs/heads/*:refs/remotes/SimplyStats/*
[submodule "externals/GoodStuffIOS"]
    url = https://************@bitbucket.org/**********/goodstuffios.git

Navigate to the source folders, find the .git folder and navigate into it. There is a config file and that contains the urls of the remote repositories:

It should contain something like this:

[remote "origin"]
  url = <remote-repo-url>
  fetch = +refs/heads/*:refs/remotes/upstream/*

Verify, if it has the correct url. Try a git clone <remote-repo-url> in some temp folder.

Here's what i had to do to fix the problem.

  • Close the workspaces,
  • Go to Organiser/Repositories,
  • then for each relevant project, select in left column and remove by clicking '-'
  • quit XCode
  • verify/clean .git/config
  • verify/clean .gitmodules
  • reopen XCode
  • open workspace

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM