Answer the question
In order to leave comments, you need to log in
How to use GIT correctly when working on a SPA application for one developer?
Hello.
I avoided using GIT for a long time, but it was time to overcome my fears.
I am developing a SPA application in JavaScript and php (in the future, replacing it with Node.js) on the server to implement the API.
That is, I immediately do both front and back.
There was a sharp question about versioning the code.
Before implementing some new feature or refactoring, you just have to do a manual backup of files both on the client and on the server, and sometimes also the database structure.
Can you please tell me how it would be most efficient to implement GIT in order to simplify all of the above?
That is, I would like to save both JS and PHP code with one commit.
I use Atom, but I can easily switch to any other free editor/IDE.
I am developing directly on the working vps using the ftp plugin for Atom, which allows you to edit files on the server as local ones.
Answer the question
In order to leave comments, you need to log in
It's not clear what you mean by "correct". Get GIT and just use it. All our projects are divided into two branches (SPA. Vue + Laravel):
1) master
2) develop
Development is carried out in develop, when everything is tested, merge is done in master. If you have some big feature, then you can branch from develop and when it is finished merge and delete it.
This is more dependent on your needs.
Usually they make two separate git repositories for front and back.
So you can always roll back changes for them separately.
But perhaps, since you are developing alone, it will be more convenient to use one repository for both back and front.
But I still would not recommend making commits in which there are changes for both the front and the back at the same time. It is better to separate them as much as possible.
If I correctly understood your needs, then you should not bother much about it, but just start using it. And over time, an understanding of what exactly is needed will come.
The main thing is not to forget to store everything on something like a bitbucket.
And yes, in order not to backup the database structure, use migrations if you are not using them yet.
Hello.Hello.
I am developing a SPA application in JavaScript and php (in the future, replacing it with Node.js) on the server to implement the API.What exactly you are developing and on what - it does not matter if the source code is files.
Before implementing some new feature or refactoring, you just have to do a manual backup of files both on the client and on the server, and sometimes also the database structure.Instead, just go ahead and make a new branch.
Can you please tell me how it would be most efficient to implement GIT in order to simplify all of the above?For the most efficient implementation of Git - usually use its installer (installer, package, etc.) for the appropriate operating system.
I use Atom, but I can easily switch to any other free editor/IDE.Git is not related to editors and/or IDEs in any way, you can use anything or even a third-party Git client like TortoiseGit (and others like that).
That is, I would like to save both JS and PHP code with one commit.You can save any number of files in one commit (if you go into too much detail, then deltas of file changes, but this is not very interesting for you, I think).
I am developing directly on the working vps using the ftp plugin for Atom, which allows you to edit files on the server as local ones.You can put Git incl. and to a remote server and update the project files there using "push", but, taking into account the context of your question, I would still recommend that you first understand Git better, and still install the server for development locally and not tease grandma.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question