Giter Site home page Giter Site logo

error in git push about deliver HOT 6 CLOSED

gerhard avatar gerhard commented on August 21, 2024
error in git push

from deliver.

Comments (6)

gerhard avatar gerhard commented on August 21, 2024

I must say, I am quiet surprised that this didn't work. Do you have git installed on the remote host?

While deliver is completely configurable, the default strategies rely on git.

Could you paste the entire deliver log? Deliver logs everything to /tmp/deliver-[app-name] ; ).

echo -n > /tmp/deliver-[app-name] # clear the file
deliver --verbose # re-deliver the app
cat /tmp/deliver-[app-name] | pbcopy # let's see the log then!

from deliver.

videoMonkey avatar videoMonkey commented on August 21, 2024

The log as requested:

Mon  9 Jul 2012 13:50:19 CEST ::: �[1m�[32mDELIVERING [app-name] WITH NODEJS STRATEGY�[0;10m
Mon  9 Jul 2012 13:50:19 CEST ::: �[33m----->�[0;10m �[1m�[37mEnsuring remote is ready to accept git pushes�[0;10m
Mon  9 Jul 2012 13:50:19 CEST ::: [app-name]@nodejs01-[app-name] : 
    set -e
    if [ ! -d ~[app-name]/app ]
    then
      mkdir ~[app-name]/app
      cd ~[app-name]/app
      git init 
      git config receive.denyCurrentBranch ignore
    fi

Mon  9 Jul 2012 13:50:20 CEST ::: �[33m----->�[0;10m �[1m�[37mPushing new commits with git to: [app-name]@nodejs01-[app-name]�[0;10m
Mon  9 Jul 2012 13:50:20 CEST ::: JOB: git push -f [app-name]@nodejs01-[app-name] node 

And this was the terminal output:

Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 375 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/node
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error: 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To [app-name]@nodejs01-[app-name]:~[app-name]/app
 ! [remote rejected] node -> node (branch is currently checked out)
error: failed to push some refs to '[app-name]@nodejs01-[app-name]:~[app-name]/app'

FAILED  1:
git push -f [app-name]@nodejs01-[app-name] node 

I was looking at your code and it seems that the adjusting of the setting in git to recieve is not happening. If I ssh into the server and do a git pull before running the command everything happens just fine. It's only when I have changes to run that things go wrong.

For my part, don't worry about this too much, I have the code running on what will be the production server and I really need to get back to site/app code. I want to revisit deployment later this month.

from deliver.

gerhard avatar gerhard commented on August 21, 2024

There's something different about your setup. I have a feeling the git config receive.denyCurrentBranch ignore command doesn't get to run (and potentially the git init before). Maybe a permissions issue?

This will sound a bit hack-ish, but try changing the set -e to set -x in the deliver/libexec/common file, init_app_remotely() function. Now run deliver in verbose mode (-V or --verbose flag). This ought to flush out the specific failure.

Just pushed a nodejs app for the first time, to a local VM. That's using a slightly customised nodejs strategy, but nothing special.

from deliver.

videoMonkey avatar videoMonkey commented on August 21, 2024

Well, today is live day, and I am working from a different development station but with all the same code and things seem to be working. I am going to close the issue.

from deliver.

gerhard avatar gerhard commented on August 21, 2024

Glad to hear things are working!

Would be interesting to find out what exactly was going wrong (for future reference). It's not important though, happy to leave it at this. Cheers!

from deliver.

bijanv avatar bijanv commented on August 21, 2024

This happened for me as well, had to do a git push on that branch on the remote server and then try deliver again and it worked.

from deliver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.