开发者

Git push to live server through limited ssh

开发者 https://www.devze.com 2023-02-04 15:57 出处:网络
I\'m using GitHub to keep track of my source code. Although I work alone, it comes really handy to test new features and rollback if it doesn\'t work. So, I installed in Git Bash in my window开发者_开

I'm using GitHub to keep track of my source code. Although I work alone, it comes really handy to test new features and rollback if it doesn't work. So, I installed in Git Bash in my window开发者_开发知识库s machine, and commit & push to github when the code is ready.

Now, I want to take this further and deploy from the same terminal. My shared-hosting has SSH access but is kinda limited. They told me they had Git, but only as a client, to read repos. I don't know what that means.

I was trying to make a repo on the live server, add it as remote on my machine and then just 'git push remote live' but that didn't work.

Whenever I type 'git init' on the live server it returns:

warning: templates not found /usr/share//git-core/templates/

Initialized empty Git repository in /www/example.com.ar/htdocs/example.com.ar/.git/

And I can't 'git clone' or 'git pull' or anything!

Is there any tips you can give me? I'm just tired of drag&dropping my folder via FTP, it just feels so wrong!

Thanks in advance


GitHub is the git server

Both you and your hosting will simply act as clients.

all you need to do (if git is properly installed) log into your ssh session.

type the following into the terminal

git clone git://github.com/<username>/<name of repo>.git folder_name

to clone that git repo into folder_name

to get updates you have pushed to the live server, you need to again, log into ssh and git pull


This is how I do it:

http://philsturgeon.co.uk/news/2010/02/Deploying-websites-with-Git


There is a git server that'll handle incoming git requests so you don't need to access it via SSH. It's not very popular (relative to just the client) and you don't need it. The git client should be all you need. It sounds like there is something else wrong with their install.

Perhaps someone else can chime in here and get git working in this limited environment for you, but when there are so many dirt cheap and really flexible hosts out there it's probably much easier to switch to one of them and solve a whole gamut of problems all in one.

Dreamhost, MediaTemple, RackspaceCloud, Slicehost, and (of course) Amazon EC2 are just a few of solid hosting services worth checking out.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号