'git alias not specified but data pushed to github

I'm new to github. I started with

git remote add origin URL

This linked my local files with the github account. I then did:

git push -u origin master

This copied my files to github

I then proceeded to make some changes to my .py file in the local repository and then saved it. I did this to test the commit + push feature. Next I typed:

git add.
git status
git commit -m "Q1 solution"
git push

The code pushed to github but I am not sure if I did it correctly. Youtube videos are all saying I should have done git push origin (the alias-ed URL). Do I need to do this or is git push enough once you've done the initial setup with:

git push -u origin master

Edit: git status

gives me:

On branch master
Your branch is up to date with 'origin/master'.

Not sure what this means origin/master?!?

Thanks,

git


Solution 1:[1]

My friend you pushed it correctly to the master branch

when we use :

git push

it's pushed automatically to the repo and into the branch where you are which is the master branch

when should I use the full hand version?

git push [alias] [branch]
git push origin main/master

we use this one when we want to push our changes to another branch

and you can

create a branch in git

git branch [name]

then you want to make changes in just this branch you should stage it

git checkout [name of the branch]

and you can add or commit without changing anything in the other branches

check this cheat sheet https://education.github.com/git-cheat-sheet-education.pdf

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KroKing