Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:08:01+00:00 2026-06-09T14:08:01+00:00

I’m currently testing out deploying websites via Git and am having trouble understanding the

  • 0

I’m currently testing out deploying websites via Git and am having trouble understanding the following:

Currently, I have a bare remote repo on my DEV environment with a post-receive hook which sets GIT_WORK_TREE to my webroot. I push to there from my local repo with syntax like ‘git push DEV master’. This works great. However, I also have a ‘develop’ branch which I push to DEV (the post-receive hook is set to ‘git checkout -f [BRANCH_NAME]) and this also works great.

My question is for the following situation: let’s say that I find a bug on DEV (pushed from ‘develop’ branch) but I don’t have time to fix it (maybe there is a client review that day). I would love to be able to do a ‘git push DEV master’ (the master branch has the last bug-free push to DEV and is an ancestor of the develop commit currently on DEV) and be done with it. But, when I do this, the remote repo tells me ‘Everything is up to date!’ I suppose that makes sense, but what I would like to do is force git to take the push from ‘master’ branch and fire the post-receive hook anyway, which is necessary for proper deployment of web assets.

I tried going directly to the remote repo in ssh and attempting to checkout master from there, but it tells me I need a work tree to do this (because it’s bare, I assume).

What is the correct method of doing this? I’d like to avoid doing a revert or rebase if possible, but maybe that’s the only way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:08:02+00:00Added an answer on June 9, 2026 at 2:08 pm

    , but what I would like to do is force git to take the push from
    ‘master’ branch and fire the post-receive hook anyway, which is
    necessary for proper deployment of web assets.

    The problem is that you have already pushed the changes to your remote, so there’s nothing to push. Your options include:

    • force a change in your local branch…e.g., by updating a serial number in a file, committing, and pushing.
    • just running the post-receive hook on the server by hand, filling in the necessary environment variables.

    Going to the remote repository and trying to checkout the master branch should work, provided you have both a repository and a working tree (possibly by setting GIT_WORK_TREE yourself). However, this isn’t going to trigger your post-receive hook, so you’ll need to manually take care of any additional logic that’s there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.