Reputation: 1557
I currently have a system that goes like this:
Local Host: This houses the repo that I change and commit too.
Remote live host: This houses the master branch
I have a github webhook which trigger git pull once a change is commited and synced on local host.
When I setup the remote live host I did,
git init
git pull https://github.com/myusername/myrepo.git
It cloned the repo but the permissions were all messed up. I changed all the permissions around and everything seemed to work great.
Then I made some changes to sidebar.php and synced with github.
When running git pull on the remote host I get:
From https://github.com/blablabla/repo
* branch HEAD -> FETCH_HEAD
Updating d676e29..9cd0f26
error: Your local changes to 'sidebar.php' would be overwritten by merge. Aborting.
Please, commit your changes or stash them before you can merge.
But there was never a remote change on the server. If i change my local sidebar.php back to the original before the commit, sync it and pull on the remote live host, It then says Up-To-Date
I have been battling with this thing for 3 days and can't seem to get it working correctly. I just want the remote live host to pull whatever is new from the repo since I did a syn from my local host.
Upvotes: 0
Views: 584
Reputation: 353
When you created the repo you didn't do all the stuff needed. I can't be sure of it because I use to create my own remote repo but maybe that will help.
Do:
git init
touch Readme.md
git add Readme.md
git commit -am "Initial commit"
git push
Then you clone and work on your local machine.
Upvotes: 0
Reputation: 31622
It seems like git changing file permissions is causing the issue. Try
git config core.filemode false
in the remote repo (see this question for more info).
Upvotes: 2