1

I am working on a repo and I did some local commits and now I want to do git pull origin develop whithout any change .. what should I do please ?

Melek Yilmaz
  • 409
  • 1
  • 5
  • 16

3 Answers3

1

You can do

git log

for check the commit history. There you will find your commits. Take the commit number which is before your local changes. Then do

git checkout -f {Commit Number}

Then you will be your initial state (before make any local changes). Then do

git pull origin develop

The develop branch will update then. And i think you will get your expected result.

Saleh Ahmad Oyon
  • 672
  • 1
  • 6
  • 20
0

Try git pull --rebase, it will make a three way merge and make your commit be the new HEAD. Please let me know whether this command helps.

Elinx
  • 1,196
  • 12
  • 20
  • it gives me `You are not currently on a branch. Please specify which branch you want to rebase against. See git-pull(1) for details. git pull ` it means that I should do ` git pull origin develop` but when I do it gives me the my expected result + some changes from the local commits – Melek Yilmaz May 28 '16 at 17:29
0

You are not currently on a branch. Please specify which branch you want to rebase against.

That means you are currently in a detached HEAD: check that with:

git branch -avv

If you think you should be in the develop branch, reset it to whare you are:

git checkout -B develop

Then you can try git push origin develop again.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250