Home > Software design >  Git Push "everything up to date" but file on github not change
Git Push "everything up to date" but file on github not change

Time:10-13

after i learn to commit a file to github. now i have try to update file on github by run syntax

git push -u origin main

and output message

Everything up-to-date
Branch 'main' set up to track remote branch 'main' from 'origin'.

when i check again on github the file that i was push no change at all enter image description here

here my local file

enter image description here

please help me, im new to github

CodePudding user response:

Have you committed first? With git, you need to commit your changes first, which is like saving each version locally. Then, when you push, you are publishing all of your versions to the remote (github).

Try the following:

git status

if it tells you about untracked files, use:

git add <filepath>

then:

git commit -m "<some commit message>"

This will save your changes as a commit locally, and you can now push this commit to github with the push command you used earlier.

  • Related