V
V
Vladimir2018-01-28 19:42:08
git
Vladimir, 2018-01-28 19:42:08

How to git push to a folder via SSH?

There is a local repository, there is access to the server via ssh, but there is no way to install git on the server. As far as I understand, to add git add remote to your local repository, you need to do git init on the server, but do not install git on it.
How to push to such a folder?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arman, 2018-01-28
@Arik

You can try to mount the remote server as a folder, I used SSHFS, and then work with this folder as a local one. Naturally, the number of operations will go off scale, but I can’t tell how much

A
Alexander Movchan, 2018-01-28
@Alexander1705

It says the following:git init --help

DESCRIPTION
This command creates an empty Git repository - basically a .git directory with
subdirectories for objects, refs/heads, refs/tags, and template files. An initial HEAD
file that references the HEAD of the master branch is also created.

So, at your own risk, you can try the following commands:
mkdir .git
echo "ref: refs/heads/master" > .git/HEAD
mkdir .git/objects
mkdir .git/refs
mkdir .git/refs/heads
mkdir .git/refs/tags

Although it's better to just copy the folder:
git init repo
scp -r repo [email protected]:/path/to/repo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question