• 0

What's the best way to sync my local git repo with my server?


Question

Okay. I'm not sure how to go about this, so here's the background on the subject. I have had my site up since 2011 and have a LOT of commits on my local server. Up until now, I haven't had SSH access and I was using git-ftp, which stores just the most recent commit on the server so that the ftp script locally knows what to push. I've tried the following:

 

1. Wiping out my server and pushing locally to the server ( I got an out of memory error and it hung up)

2. Pulling from the server into my local repo, which causes an endless rebase. 

 

How do I get them to sync up and not end up going through a rebase of EVERY SINGLE commit. Can I skip all but the most recent? I spent a long time yesterday working on this and googling and I hit a wall! Any assistance would be greatly appreciated. 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

How big is your repo?

 

Because if I am reading it correctly, all you are trying to do is push your local changes to your server, right?

 

Shouldn't you just do the following on your local instance?

git remote add origin user@server:/path/to/remote/git/repo
git pull origin master
git add *
git commit -m "whatever"
git push origin master

The assumption on the above code is that you checked out the 'master' branch on your local instance. Are you saying git push gives you the out of memory error?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.