S
S
Sergey2016-08-16 09:00:37
git
Sergey, 2016-08-16 09:00:37

How to set up Git to deploy small web projects?

Good evening! This is my first time trying to set up a server to deploy small sites. I get after git push alias master

fatal: '/.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

What is:
- post-repository git init --barein site.com/.git
- local repository with master branch
- post-receive file with contents in the hooks directory
#!/bin/sh
GIT_WORK_TREE=/www/site.com/.git git checkout -f

- ssh: [email protected] (after connecting via ssh in the terminal I get such a path to my repository www/site.com/.git/)
- unsuccessful attempts to "push" after git remote add ssh://[email protected]/.git
I would be grateful for hints where to "dig"!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-08-30
@zeyser

Guys, I was wrong with the paths to the repository (which is not surprising based on the error). So that you do not repeat my mistakes, I advise you to execute pwd after connecting via ssh to your site. We specify the result in hooks and when adding to remote add.
A couple of links based on:
ruhighload.com/post/Git+%D0%B4%D0%BB%D1%8F+%D1%80%...
toroid.org/git-website-howto
ru.stackoverflow.com/questions/ 428483/%D0%9D%D0%B0...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question