S
S
sadieff2018-07-04 18:18:12
git
sadieff, 2018-07-04 18:18:12

How to work with git on hosting?

Good day, developers!

I watched video tutorials, read books and now I want to get started with git. But not everything is clear to me.

So, I work on beget.ru hosting, editing files via FTP. Sometimes another person can connect to fix something. They used to overwrite each other. How can I switch to git now?

I sshed in, changed to my working folder, and did git init. Do I understand correctly: now this will be a repository to which I can connect? Do I have to add folders and files to the repository, then connect via git from my computer -> git clone, work on the files and git push?

Or the remote repository can be, for example, on the github, I pour all the changes there, but from the github to the hosting?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
noma, 2018-07-04
@noma

It makes sense to start a turnip on a specialized GIT server like GitHub, GitLab, Bitbucket.
Before starting work, each of your colleagues does a git pull - gets a local copy of the turnip.
At the end of the work, each of your colleagues does a git push - sends data from the local to the GitHub/Gitlab/Bitbucket server.
Plus, you will need to somehow resolve situations when you spoil the results of each other's work - through git merge or through git branches
... and not from a local turnip) is a separate operation.
Git synchronization with hosting how?

G
GavriKos, 2018-07-04
@GavriKos

It is possible either way. Better - through the "intermediate" github.
Well, you made a mistake in the git commands, but in general, yes.

A
Alexey P, 2018-07-04
@lynxp9

It is possible through an intermediate Github or Bitbucket. You can install it on your server https://about.gitlab.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question