0

my git remote origin is my working directory, and my git remote 'upstream' is a project on which my development based. when i use

git pull upstream master

I can see that i've got the latest changes in the upstream directory, and I use

git add --all

git gives out some insertions, some deletions which are all right.

But when I use:

git commit -m "..."

I always get this error

nothing to commit working directory clean

and

git push origin master

git says

already up to date

I check my origin directory and find it does not contains the latest updates in upstream directory

I've seen the same question. He says he encountered this problem because he enters a wrong direcotory but i'm sure i 'm in the right directory.

I asked someone, he used

git log

to find out my newest commit serial number and used some commands like
git merge (commit serial number) which solve my problem but I forgot the exact command he used.

He explained that the HEAD pointer points to another position which is different from my newest commit but i didn't quite understand at that time.
I'm not familiar with git, can somebody explains why this happens and how to solve this problem? (Like I said, I forgot the exact command he used and I encountered the same problem now and I don't know how to solve it)

Community
  • 1
  • 1
marcus
  • 11
  • 1
  • 1

1 Answers1

1

After fetching from the remote branch, you would still have to merge the commits.

git fetch upstream
git merge upstream/master master
git rebase upstream/master
Amandeep Gupta
  • 161
  • 2
  • 15