Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

error: src refspec main does not match any

Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi experts,

I have been trying so hard to push my files to github to no avail.  It's been 2 days already and nothing seems to work.
Hope someone can point out to me what is amissed in my steps.

Saloon Keeper
Posts: 13427
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't push because you have nothing committed.

You can't commit because you have nothing added to the index.

You can't add because the file path of one of your untracked files is too long:

The naive solution would be to change the file path of these files.

The real solution is to ask yourself why you're trying to add these files to your source repository in the first place. You should only add hand-coded source files; not binaries, generated source files or tools.

What does your .gitignore file look like? You should set it up so it ignores everything except Dockerfile,, pom.xml and the src/ folder.

What's inside Servers/ and myPetStore/? Nested projects that you want to add to your repository as well? Then put .gitignore files inside those folders as well and configure them properly.

As a final remark, ALWAYS run git status before running git commit. It will display what files you have added to the index before you commit them. Make sure you haven't added any files you don't want committed.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic