Home > Mobile >  git not showing added files to staging area or committing files to repo
git not showing added files to staging area or committing files to repo

Time:07-12

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

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