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

  • Home
  • SEARCH
  • 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 1091631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:33:34+00:00 2026-05-16T23:33:34+00:00

This is probably quite a newb question, but I can’t seem to figure it

  • 0

This is probably quite a newb question, but I can’t seem to figure it out.

Here’s what I did…

On the server (via ssh):

  • Created a site on a dedicated server
  • Created a git repo there (git init I think?)
  • Added and committed everything

At my office:

  • Cloned the repo on my development machine
  • Pulled everything
  • Made some changes to local files
  • Added the files again (is this right? not like svn!)
  • Did a commit
  • Did a push

…now, on the server, if I do git show, it shows a diff where the server’s last copy of stuff is removed and the stuff I pushed from my office is being added. That’s what I want to happen. What I can’t figure out is: what do I need to do on the server to make the changes I pushed from my office become “live?”

I’ve had pretty good success deploying websites with svn in the past, and I figure I can get away with it with git too… but obviously I’m missing some piece of the puzzle. Thanks for any help.


edit – I just noticed this post: Git – pulling changes from clone back onto the master

Should I be pulling my office repo onto my server instead of pusing it there? So ssh from the office into the server and then have it git+ssh back into the office to pull that repo? That seems kind of crazy, I’d rather figure out how to make the push go through if possible.


rephrasing the question

I really just want to apply the patch shown by git show. Does git have a built-in way of doing that?


answer

It looks like git checkout -f on the server did what I wanted, but creating a –bare repo would have been a better way to go (I’ve changed to this setup now).

  • 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-05-16T23:33:34+00:00Added an answer on May 16, 2026 at 11:33 pm

    Usually on the server you would do a git init --bare which creates a repo with no working directory. If that is the route you took then you would have to pull the changes from there to the web directory as the “deployment” step. So your work flow might look like…

    On dev PC:
    
    1. git clone <path to server repo>
    
    *make code changes*
    
    2. git commit -am "fixed a bug"
    
    *add some new feature*
    
    3. git commit -am "added cool new feature"
    
    4. git push origin master
    
    
    On the server:
    
    *cd to www folder*
    
    5. git pull
    
    1. Clones server repo to your dev machine, which you’ve already done
    2. Commits the bug fix to your local repo…not the server’s repo
    3. Commits the new feature to your local repo…again, not the server’s
    4. Pushes all changes from your master branch to the server’s master branch

    At this point, none of your changes are visible on your website. You would need to “deploy” them.

    5.Pulls the latest changes from the central repo on the server to the web server’s folder(s) that are being served up on the web.

    There git tutorials are very good as is “Pro Git“, a free online book

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

Sidebar

Related Questions

This is probably a very obvious question but I can't quite figure it out.
This is probably a really simple question but one I've never quite worked out
this is probably quite a simple problem, however, I can't figure out how to
This question is probably quite dumb, but I can't find an example and can't
This is probably quite a straightforward question, but I can't find an answer elsewhere
This is probably quite a simple question, but I can't remember how to do
This is probably quite simple but I can't seem to find it readily. In
This is probably quite simple to do.. but I just can't think of how
This is probably quite straight-forward but at the moment I can't think of a
This is probably quite simple but I've googled and can't find an answer. I

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.