Home > Net >  Why don't my files show up in Github after pushing from local?
Why don't my files show up in Github after pushing from local?

Time:10-18

This one should be my first push from the local repository I've created with git to my Github repository. I believe my issue comes from my attempt of pushing, maybe something I misunderstood. By the way, in what follows I show to you the git commands I've typed into my terminal with comments:

Once I'm in the folder with all and only the files I want to store into the master branch of the repository, I type

git init

and I've initialized my git repository.

git add .

I've added all the files in the folder into the master branch of the local repository previously created

git commit -m "That's the first commitment!"

Now that the commitment is ready, I create a repository in my GitHub account, the link of which is enter image description here

I don't see any copy of the files in the folder previously mentioned. It looks like everything is ready, but still, I do not have any copy of it.

Is there anything else I should have to type into the terminal? Is there anything wrong I did?

CodePudding user response:

you are pushing to the master branch, where github is defaulting the main development branch to main. your branches and your changes are there, just in a different branch.

enter image description here

You need to either:

  • push to your main branch instead of master

    • initially: git push -u origin main
    • to change a wrong upstream (in your case): git branch -u origin/main
  • or change the default branch to master (not recommended) change default branch

  • Related