gitgithub

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


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 https://github.com/stefanovic80/physicsComplementsITISstudents

Here comes the issue:

git remote add origin https://github.com/stefanovic80/physicsComplementsITISstudents

in order to provide a kind of link between the local repository and the one on GitHub. I expect that after typing

git push -u origin master

and providing my username and token, I will have a copy of all the local repository on my GitHub account. Git does not provide any message of error, but still, it looks like something I misunderstood here, as all I get in my GitHub account is reported in the following screenshot

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?


Solution

  • 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: