gitomatic icon indicating copy to clipboard operation
gitomatic copied to clipboard

Error cannot pull from repository

Open deadpyxel opened this issue 5 years ago • 7 comments

So, I have been interested to use git-o-matic to deploy some internal network containers using git-hooks automatically.

The way I have in mind is using git-o-matic to automatically pull changes in my develop branch and use my post-merge hooks (Already working) to restart the container with said new code.

My problem is I keep getting the following message:

2020/02/17 15:04:57 Checking repository: .
2020/02/17 15:04:57 Pulling changes...
cannot pull from repository: non-fast-forward update

The way I am launching it in my server is:

gitomatic -privkey <path-to-my-deploy-key> -pull=true -push=false <path-to-my-local-repo> 

Any help regarding getting this to work would be appreciated.

deadpyxel avatar Feb 17 '20 18:02 deadpyxel

It looks like your repository has uncommitted/unstashed local changes. Since non-fast-forward updates could cause merge conflicts, gitomatic is currently not attempting to fetch any updates. This could be improved, but it'll always be a difficult situation to handle for an automated system like gitomatic.

muesli avatar Feb 18 '20 04:02 muesli

So I did some verifications, and even cloned the repository again, but keep getting the same messages. Nothing is stashed or un-commited.

If it's important, git-o-matic was installed using the binary package.

deadpyxel avatar Feb 20 '20 22:02 deadpyxel

Could you do a git status in the repository and attach the output, please?

muesli avatar Feb 20 '20 22:02 muesli

I'll do. Can't access the server right now due to an outage. but ASAP I'll post here.

deadpyxel avatar Feb 20 '20 23:02 deadpyxel

Ok, here it is:

On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean

To be more clear in what I want to accomplish and my current setup:

  1. I generated and added a new deploy key to this repository, with pull access
  2. I cloned the project and pulled from develop branch with git checkout --track origin/develop
  3. The git-hook I setup is triggering when I do a manual git pull
  4. The deploy key has no password, so there's no additional authentication needed besides passing the private key if I understood correctly.

I have all this setup on a Debian 10 host, using latest binary release of git-o-matic.

deadpyxel avatar Feb 22 '20 02:02 deadpyxel

Ok, looks like a problem with tracking a non-master branch. I'm looking into this right now.

muesli avatar Feb 25 '20 06:02 muesli

Thanks, is there any additional info I can provide you with?

deadpyxel avatar Feb 25 '20 14:02 deadpyxel