Answer the question
In order to leave comments, you need to log in
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
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.
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question