Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Source Control - Push local changes stuck on Loading

I keep getting this problem with Xcode source control. If I checkout a previous branch and then switch back to my latest branch, sometimes I can no longer push to my remote as it's stuck on loading.

enter image description here

I did find some workarounds which fix the issue like clone the project or use the terminal to push local changes but is there a better solution to fix it within Xcode.

I tried to reconnect my bit bucket account, clean build folder, update Xcode and restart everything but that solved nothing.

like image 976
STerrier Avatar asked Sep 09 '19 02:09

STerrier


2 Answers

I managed to finally fix the issue. The issue seems to happen when checking out a previous build in Xcode. This would disconnect the remote which would cause it to be stuck on loading.

To fix it first, push any uncommitted work using the terminal e.g. git push origin head:master

Go to the Source Navigator in Xcode and check that the push you just committed is in the remote folder. For me, it's my remotes>origin>master

Then delete the master branch from Branches>master and then checkout Remotes>origin>master branch

The source control will now be able to push from Xcode. I hope that helps.

like image 67
STerrier Avatar answered Sep 20 '22 21:09

STerrier


It took a day to find out the easiest solution. You can re-install the Xcode but that's really time consuming and you can face the same problem again.

Just follow these steps to sort out the issue very fast:
1. Download and install Github Desktop.
2. Quit Xcode application and clear Xcode cache files.
3. Locate a local repository using Github desktop and click on "Fetch origin".
4. Make some changes, commit and push to your current working branch, it might be master branch.
5. Check latest commit message from your web browser, if you can see the latest commit then the problem has solved.
6. Just open the Xcode app, make some changes and try to commit and push. Great... Everything will work smoothly as it was before.

like image 21
Faisal Mahmud Avatar answered Sep 19 '22 21:09

Faisal Mahmud