H
H
h0tah2015-06-24 18:16:44
git
h0tah, 2015-06-24 18:16:44

What is the right way to get started with git?

Hello! I have this situation: on the same server there are two sites, test and combat. On the same server, there is a remote repository that combines these two sites. What actions need to be taken on the test and production server in order to start working with git and successfully push and pull data from a remote repository? Having registered git status on test or production, I see that all files are untracked. Do I need to add those files and directories with which I will work under git with the command git add index.php /catalog/ etc.? Then, after the git status command, I will see new file: ... and a bunch of files, do I need to commit them on the test and production server so that I can track changes? And then, changing any file under the git, commit and push/pull it? Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
abcd0x00, 2015-06-25
@h0tah

You need to make one bare repository, place it in an accessible place (with open ssh), and then clone it (via ssh) in the places where it will be used.
Practice on a test repository that has one file.

C
caution, 2015-06-24
@caution

f3088749055c4f3686088d7b8f3b8f34.png
1) When working locally (1 square), you push to a remote git (2 square). And when you make a deployment script takes info from the remote repository (2 square) and pushes it to the remote repository on the deploy server (3 square)
*) Standard work with git.
git init
git remote add
git add .
git commit -m ""
git push
If you want to push directly to the deployment server. Then you need to do a git clone from the remote repository. Next, add a link to the remote repository git remote add. Further, everything is according to the points of standard work after git remote add.

U
ummahusla, 2015-06-24
@Antonoff

Free, easy to understand, understandable
https://www.codeschool.com/courses/try-git

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question