Michael Mikhjian
Michael Mikhjian

Reputation: 2794

Git Push Remote Modified files

I'm using git server on a development environment to essentially be the "ftp" / handler via SSH.

I init'd git on the remote server via bare and pushed from local. Once all settled I removed bare. I then push remote latest batch = accepted.

On the remote server I run git status and see modified files. How can it accept the changes with out having to reset or so?

Upvotes: 1

Views: 146

Answers (1)

janos
janos

Reputation: 124824

A better approach:

  1. Keep a bare repository on the server, that you will push to
  2. Create a clone on the server of the bare repository
  3. Setup a post-receive hook on the bare repository, that will do a git pull on the clone after it receives new commits

With this setup, you can push revisions to the bare repository, and its clone will update itself. I wrote a blog post on this with more details.

Upvotes: 2

Related Questions