Git status says "up to date with origin/master" after changes, but this is not the case #23047
-
I recognize that this seems like a beginner issue, but posting here is my last resort: I’ve tried numerous solutions online, and nothing seems to work. Clearly, something is off with branches. When I create changes to my repo on the browser, I can pull the changes in Mac terminal no problem. However, when I make changes in the Terminal, adding/committing/pushing does not work. Git status gives me the message:
I’ve tried lots of methods online for resolving this, including: None of these have resolved the problem for me. I would be very grateful for any help that someone could provide, and I will try to respond quickly in case you are wondering what the output of different commands are on my local config. Thanks so much! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 2 replies
-
bwinsto2:
Exactly how do they “not work”? Are you getting error messages? If so, please quote those, for each step, together with the exact command you are using.
bwinsto2:
Please be very careful trying random commands, at least one in that list is extremely destructive: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I just cloned the repo, and I don’t have any meaningful local changes. When I say the changes don’t work, what I mean is when I make changes, I get the message I copied above (aka the changes are not committing/being added to working tree(?) For example, I could do |
Beta Was this translation helpful? Give feedback.
-
Ah, I see. First off, git won’t track empty directories, so that For terms, “working tree” refers to the files you can, well, work on. New or edited files (or parts of them) on the working tree may then be added to the “index”, and committed. |
Beta Was this translation helpful? Give feedback.
-
Wow, do I feel dumb… I was creating empty directories to check whether git was tracking changes. Just tried creating a file and everything worked. Thanks so much for the help!! |
Beta Was this translation helpful? Give feedback.
-
Hi all, I would like to ask the same question about a different problem. Thank you for your help. |
Beta Was this translation helpful? Give feedback.
-
adesalegn:
As long as you haven’t made any new commits that message is correct, unversioned/changed files that haven’t been committed yet should be listed below it. If unversioned files don’t show up, check if they might be hidden by a |
Beta Was this translation helpful? Give feedback.
-
Kindly asist am having a simmilar issue . someone advice on what to do and the procedure to follow kindly. Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
Hi all but it didn't push and I had the bellow message |
Beta Was this translation helpful? Give feedback.
-
On branch main |
Beta Was this translation helpful? Give feedback.
Ah, I see. First off, git won’t track empty directories, so that
hi/
directory not showing up is fine. What happens if you create a file, or modify one that’s in the repository? Doesgit show
mention that? If not, also look for a.gitignore
file, if there is one. If your file matches any of the patterns in there it will be ignored.For terms, “working tree” refers to the files you can, well, work on. New or edited files (or parts of them) on the working tree may then be added to the “index”, and committed.