**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.
CodePudding user response:
For both messages, a git status would be helpful:
- one for realizing there is nothing to add and commit
- one for checking your current branch, which might be
mainby default, and no longermaster(since Aug. 2020 for GitHub repositories, for instance)
See Git 2.28 (Q3 2020) and theinit.defaultBranchsetting.
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
