0

I am having problems doing git commit -m and git pull. I have done git init and made changes for many times and had had no problems working on branches and pushing to GitHub. However, now the problem occurs out of blue.

I can no longer git commit or git push. Every time I made changes and after doing $git add ., it shows

$ git commit -m "fixed plot fonts"
On branch convergence
Your branch is up-to-date with 'origin/convergence'.
nothing to commit, working tree clean


$ git pull
Already up-to-date.

$ git branch
* convergence
master
show
shown

$ git status
On branch convergence
Your branch is up-to-date with 'origin/convergence'.
nothing to commit, working tree clean


$ git pull
Already up-to-date.

Could someone give me some directions? Thank you!!

UPDATE

After I reinitialized git, I still could not git commit and git push.

$ git init Reinitialized existing Git repository in /Users/xyz/Documents/R packages/bio/.git/

h$ git add .

$ git commit -m "change font sizes of ggplot" On branch convergence Your branch is up-to-date with 'origin/convergence'. nothing to commit, working tree clean

yearntolearn
  • 1,064
  • 2
  • 17
  • 36
  • 2
    Did you add the files? For example `git add .` – Ron van der Heijden Mar 27 '18 at 08:02
  • Yes, I have added the files – yearntolearn Mar 27 '18 at 08:03
  • 1
    Your `git status` result doesn't show any changed files – Mehravish Temkar Mar 27 '18 at 08:04
  • But I did made change and did git add . – yearntolearn Mar 27 '18 at 08:05
  • try `git log` and check previous commits – Mehravish Temkar Mar 27 '18 at 08:06
  • git log has stopped recording since last night. The problem only occurs this morning. – yearntolearn Mar 27 '18 at 08:07
  • 1
    Your local files have the changes that you made before `git add`? Check the files and commits on the repository through browser – Mehravish Temkar Mar 27 '18 at 08:08
  • https://stackoverflow.com/questions/22067873/troubleshooting-misplaced-git-directory-nothing-to-commit does this help? – Mehravish Temkar Mar 27 '18 at 08:11
  • Thank you, Mehravish Temkar, I reinitiated but still does not work. – yearntolearn Mar 27 '18 at 08:17
  • 2
    even after `git add`, the changed files should be listed on `git status` before `git commit`, did you try `git status before` you tried git add the first time? just for trial do a temporary change in a file and try `git status` – Mehravish Temkar Mar 27 '18 at 08:19
  • Do you have this branch `convergence` in the server? Because if it doesnt have remote branch tracking it its normal to see that your branch is up to date, after all, you've just potentially commited your changes and there is no remote to track against. – kuskmen Mar 27 '18 at 08:23
  • Btw, `git log` doesn't "record" anything. If it doesn't show then you're not committing, and you can't commit without adding the files. – evolutionxbox Mar 27 '18 at 08:26
  • I was working on an app on RStudio. I had server.R open and the app "running" while I was fixing the code. I hit the save icon everytime..and did all the git procedure. Nothing went through. I then restarted my computer and RStudio asked if I wanted to save the changes and I said yes. Then everything went back to normal. I think the changes were just not saved while the app was still "sort of running'. I don't exactly know why though. When I hit the save icon, the changes did show on the app, and that's why I thought everything was exactly saved. – yearntolearn Mar 27 '18 at 08:31
  • Thank you everyone for your inputs and help :) – yearntolearn Mar 27 '18 at 08:46

0 Answers0