Reputation: 45
**edited
I'm trying to commit a file to my repo after making some changes- I initially uploaded the files to the repo directly through github.
C:\Users\me\repos\grow-my-day>git add popup.js
C:\Users\me\repos\grow-my-day>git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
C:\Users\me\repos\grow-my-day>git commit -m "Edit popup.js"
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
C:\Users\me\repos\grow-my-day>git push
Everything up-to-date
when I run git log
I see that it's saying the last change was made on July 3rd which was the initial commit.
Upvotes: 2
Views: 800
Reputation: 1329292
For both messages, a git status
would be helpful:
main
by default, and no longer master
(since Aug. 2020 for GitHub repositories, for instance)init.defaultBranch
setting.So:
git push -u origin main
Note that with the recent (Q3 2022) Git 2.37, and its new git config --global push.autoSetupRemote true
, a simple git push
would be enough.
But with the status Your branch is up to date with 'origin/main'.
, there is nothing to push anyway.
If the file is not present at all on the remote side, check if it is ignored locally.
git check-ignore -v -- popup.js
Upvotes: 1