Even though the risk of encountering an application that is not yet in a version control system decreases over time, the risk does exist. Do you know how to pull it from a server and put it in a Git repository?
4 min read
Have you ever encountered an old application that, in 2022, is still not under a version control system (VCS) like Git or Apache Subversion? A system that, in order to modify it, you need to connect to the server where the application is located and directly modify the files with vim? 🤮
At Ville de Sherbrooke, one of our main systems was. Someone could have easily introduced new changes or flaws. The only person who made the change would know why it was made! 😲
It was time to start tracking the changes in that system. 😎
Since a legacy system could be very complex, we need to structure ourselves to determine what and how we want to version it. 🤔
Our system has two environments: production and development. As they could each have a different version of the application, they will need to have their corresponding branch in Git : main and develop.
While you're thinking about Git, you can probably go to GitLab or GitHub to create a new Git repository. Make sure it's empty because it'll be a lot easier. 😉
Since the developers made changes directly on the servers, chances are there are files that we don't want to be versioned, such as copies or to-do lists.
So we need to list the files we want with an allowlist (also known as a whitelist).
We can start this list with the files on the production server since there shouldn't be many files we don't want. 🤗
If you know the extensions of files you want, you can easily create that file with a command similar to the one below.