2

i have a bash script:

cd ~/www/myprj
pwd
git pull https://usr:psw@bitbucket.org/myusr/myprj.git 
git checkout branch2
git log --oneline -n 15 --pretty=format:'%h %ar [%ai] (%ae) %s' --date=short origin/branch2

which i used to run from a php script using:

<?php system("bash ~/private/pull.sh"); ?>

I used it to pull all changes from a remote bitbucket repository and updated development version of the project. However, since recently it stopped working. After trying to trace the problem and running the commands from the terminal I found that the git pull is trying to merge the latest commits although there are no local changes?

Any idea of how can I just force the git pull and ignore local changes? or is there any other way to pull the changes without merging?

i tried git pull --no-edit but it didn't help me

phd
  • 82,685
  • 13
  • 120
  • 165

1 Answers1

0

Check first on which branch you are when doing a git pull, in order to make sure the merge step is trying to merge the expected branch.

See also your git config --local -l to check how the branches are declared/merged.
Or if you have directives like git config core.autocrlf, which could introduce local changes automatically.

Then, as a workaround/test, try and clone the repository again in a new folder, and see if the issue persist in that new cloned repo.

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