Can't push files to GitHub

I have two commits that did not push. The only info I could find was that someone tried to push too many files at one time. Hiowever, I can’t find any info on what is considered too much.

I started a new project and made a Github repo. The first two commits (code only) pushed perfectly. Now I am mostly working on image assets, and I know images take up a lot of space. I keep getting following error: SecureTransport error: I/O error. (-1).

I am not sure if the image files are too big, or how to figure out how many files I can push at one time. Also, can I delete the two commits that did not push so I can create a new commit with fewer files? Right now if I try to make a new commit, it says no files have changed (which is true).

I am worried because none of my files are on GitHub. Xcode hates me, and weird errors always pop up causing me to scrap a project and create a whole new one to solve the error. I would like to make sure the images are saved somewhere other than on my computer. I am going to save them to a flash drive, but GitHub is more convenient and I would like to save there.

Does anyone know how to work around this? Please note that I am a beginner so very explicit explanations are greatly appreciated. thanks.

Diane,

When you say “someone tried to push too many files at one time” does that mean that there is more than one person with access to that GitHub repository?

When you committed the changes to your project, did you check the box at the bottom left of the commit window to “push to remote”? If you forgot to do that then you can manually push the code to the remote GitHub repo from the Xcode menu Source Control > Push

I haven’t experienced any difficulties with pushing up multiple images that one would normally put into the Assets catalogue, though that said I have never imported really large image files into my projects either. I resize them first so that they are big enough, but not ridiculously large, just to conserve space.

When I mentioned the “someone”, that was a question on stackflow, where some one answered about the same error message I got. One of the people who responded said they discovered that they were trying to push too many files at once,

When I use the push command it starts sending the info to GitHub, but then stops with the error message. So the files never make it to GitHub. I show 4 commits in Xcode, but only 2 in GitHub. So I was wondering how to figure out if I am trying to send too many files at once. Xcode will not allow me to make a new commit so I can send less files at one time.

Maybe that explains it better. There seems to be a crash when the files are in the process of moving from local to remote. I don’t know how to figure out what’s causing the crash.

My images are not bigger that 1024 x 1024 pixels which is the largest the app icon slots allow. That said, though, there are a lot of images. I am trying to revamp the War Card Game with a 52 card deck. So there are three sizes for each card. I can’t imagine it’s too much. People must make apps with lots of images and code and what I’m doing is not that complicated.

But then we’re talking about me here.

I appreciate all the help you give me. Thanks, Chris!

From the GitHub documentation there is no limit to the number of files you can have in a Repo.

However, there is a limit of 100Mb for an individual file. I seriously doubt that you would be in that situation.

I’m not sure what the solution is in your case. When things get out of step between the local and remote repo it’s a bit of a drama to sort out. From what you are saying it sounds like the Local repo is intact and up to date. The fact that you are getting a response of “no Changes to Commit” is an indication that the local repo is reflecting the status of the Project.

The first thing you could do is delete the Remote Repo on GitHub and then re-create it. Link that back to your Xcode project and then Push the current status of your project which should push all of the commits up to the GitHub repo such that everything is synchronised. I’m guessing to some extent here since I have never had to recover from a situation like you are experiencing.

I added a new repository to the project but it didn’t work. I could not make a new commit to the new repository. So I created a whole new project, and things seem to be ok right now. K:crossed_fingers: Keeping my fingers crossed!

Thank you, Chris. You’re always so helpful.

Update - I ran into the push error again. I can commit and push, but the files don’t appear in GH. I found out that you can manually upload files to the repository, so that’s what I’m doing now. it’s kind off a pain bu at least it works.

Can you tell me the exact steps you’re using? To commit to your local repo and then trying to push to GitHub?

I’ve never had an issue pushing files.

Are you familiar with terminal?

In Xcode, I go to source control and select Commit. When the commit window opens I select the files I want to send, then check the push box. Then I tap the commit files button. Now I am getting a message that says “local repository is out of date.” I don’t know what that means so I just keep using the drag and drop method.

Due to the fact that I get errors even when I copy and paste code from the lessons, do you think I should reinstall Xcode? If I do that will I lose the projects I’ve created?

Thanks for your help.

If you manually add files to your GitHub repo that is linked to your Local project and you attempt to push changes up to GitHub then you will get a message that your local repo is out of date.

What you need to do is fix the problem so that your Local and Remote Repos are in sync and then you can continue to make updates to your project and know that any future change can be committed and pushed up to the remote repo on GitHub.

Uninstalling Xcode will not lose all your projects, those are saved onto your computer.

If you’re local repo is where all your files are up to date and what’s correct (rather than your remote repo) here’s what I would do

  1. Create a new GH repo
  2. Add your repo as a remote repo in Xcode
  3. Push all your files to GH

Make sure to delete your old remote repo

Also there is a recommended limit to what you should add to GH, but just adding a few pictures won’t trigger that.

Have you watched the GH module in iOS foundations?

Michelle, yes I watched the mod about GitHub. You taught make how to do it! I created new repos twice and new projects twice. At first I can push files just fine, then something goes wrong.

Chris, how would I sync the local and remote repos?

You are pretty much going to have to do as Mikaela has indicated in her post above

  1. Create a new GitHub repo
  2. Add this new repo as the remote repo in Xcode
  3. Push all your files to GitHub using the Xcode menu option Source Control > Push

sigh…ok, I’ve already done that three times now. Each time it causes me to create a new project.

You should be able to use the existing project. All you are doing is providing a different remote repo.

  • To attach a remote repo select the Source Control navigator in the left panel (the second icon from the left)
  • click on the little indicator to the left of the ProjectName to expand the content
  • select the Remotes group and then right click your mouse and select “Add existing remote”
  • key in the url of your new remote repo you just created and tap on Add
  • from the Xcode menu select Source Control > Push

I have tried doing that but it does not delete the commits to the previous remote. Then when I try to commit to the new remote it doesn’t show any files to commit. It seems to think I already committed them.

I think you’re missing a step somewhere. Can you record your screen (you can use QuickTime) and show us exactly what you’re doing?

Dianne, there is no need to attempt to commit again because the local repo attached to your project is likely up to date so will tell you there is no changes to commit.

If you follow the steps in creating a fresh GitHub repository and attach that to your existing project as I described, all you need to do is use the Xcode menu and select Source Control then Push…. Do not attempt to create a new commit. The Push menu option will transfer all of the individual commits up to the new Gihub repo.

IF after the Push up to GitHub the new repo still does not show all of your files (I would be surprised if that were the case) then there is obviously a problem with your local repo attached to your project. We will cross that bridge when we get to it.

Ok. I am reinstalling Xcode and will try that as soon as the download is complete.

Mikaela and Chris, I made a video but I can’t upload it because the extension is .mov? Can I change that to something else?