D
D
DocTypeMaster2021-08-17 10:29:49
GitHub
DocTypeMaster, 2021-08-17 10:29:49

How to upload a project to github that is already on the server?

Tell me, if I already have a Laravel project on the server, how can I drag it to git? or how to connect git to the server to push updates to the server? And what should be in the ignore file, I chose the Laravel configuration when creating the git, but I don’t know if it is complete or not.

I understand that everyone is already working with the git and my question will seem like a curiosity, but I don’t understand)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin B., 2021-08-17
@Kostik_1993

When creating a project, there is an instruction in the git, it was enough to try to run it at least once.

V
Vladislav Orlov, 2021-08-17
@haveacess

Deploy git locally, poke around, see how it works.
What you will need -
1. Initialize the turnip.
2. Create two branches (the first branch is master - as a rule, they store what is already in development here, so you can rename it to dev - but in general there is not much difference as you call it; the second is prod - just what you have on the server).
3. add a gitignore file including .env/vendor and other stuff that you don't need in the turnip.
4. initialize the turnip on the server, switch it to the prod branch (not checkout if anything) and do git add . (add all files, consider .gitignore)
5. git commit -a -m "init project"; git push - I don't think additional comments are needed here
6. on the local machine git pull - that's it. You make some changes in the project. as soon as I'm ready to show it to the world - commit, push, merge with the prod branch. And then in production - git pull - all your changes on the
ps server, do not forget to set up git via ssh, and not via login-password. + Add a password when creating an ssh key to it. Good luck!
ps s using git once, it's just not possible to refuse it later, it's just much more convenient - you just need to figure it out

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question