1

I have a bare repository in my remote server. Files get uploaded on the remote server, now I would like to sync or pull those uploaded files to my local repository.

I usually run git push website in order to deploy my local committed files, now I would like to do the opposite. How can I do this?

Thanks

6
  • Do you mean that users upload files to the web server, and they get saved to the file system, and now you want to retrieve them using git? Commented Jul 27, 2011 at 23:22
  • that's right, basically bring those files to my local server/repository. Commented Jul 27, 2011 at 23:23
  • How are thye "uploading" the files? git push? Commented Jul 27, 2011 at 23:37
  • right, if I do git pull website I get: Already up-to-date, and I think this is due to the same reason Ryan mentioned. Are there any other solutions to this? Commented Jul 27, 2011 at 23:44
  • @Andy: files get uploaded using a web interface uploader. Commented Jul 27, 2011 at 23:49

4 Answers 4

2

You can do this by running git pull GIT_SOURCE where GIT_SOURCE is in the form [email protected]:facebook/credits-api-sample.git

Sign up to request clarification or add additional context in comments.

Comments

1

If I understand this, then what you're trying to do isn't possible. A bare repo is characterized by not having a working copy in the file system. Therefore no file on the disk of a bare repo can be part of the repo, and you can't pull it as a result. If it were a non-bare repo and files were uploaded into the directory where the working copy is checked out, you'd still have to add and commit the file(s) there before you'd be able to pull them from somewhere else.

Comments

0

Use git pull (manpage).

$ git pull REPO_URL 

What $REPO_URL is depends on your setup. Maybe

$ git remote show website 

will give you a clue.

Comments

0

what you have to do is a pull of you bare repository, here is an example

at your website host you have two repositories

  • repository_bare.git (bare repository)
  • repository_webapp (non-bare repository)

at your local copy - local_repository

1) you push at your local_repository and upload the modifications at your repository_bare.git 2) you pull the repository_bare.git from local_repository

git pull repository_bare.git 

This will merge the modifications from your bare to your local repository

Here is a link with more information http://book.git-scm.com/3_distributed_workflows.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.