Using a separate version control system for changes when major version control is not available

Here is my situation:

The project I'm currently working on uses a version control system (Microsoft Team Foundation) that was hosted and managed remotely by a client. I am responsible for doing massive refactoring / bug fixing after someone who left a terrible mess of code behind. For several reasons that I will not be in detail here * I cannot fix version control incremental changes during the patch of things up; and I can’t get a separate branch.

Here is my question:

I want a version control system that I can use locally. I can’t just do a “zip source folder and back up”. I want to track changes. I want to commit messages. I want to see what I did, and when and why in a couple of months. As a last resort, I was tired of relying on the VS 'undo' command and leaving comments myself, keeping track of what I was doing and how it was before.

Here is what I would do:

I would install locally mercurial / git and start managing versions of my own directories.

The problem is that I'm not sure if this is the best way. Advice? Ideas? I don’t know either Visual Studio or Team Foundation at all, and I don’t seem able to find the way with them (I don’t know how things are “named”, so I don’t know what I’m looking for) Is it possible using such tools do what i described?

* basically, the client does not have to know that our lead developer has come out of anger and left the most terrible code mess I have ever seen behind me; that at least 3 people "tried to fix" their code in a hurry to fix the errors; that it ended in the same class with a 400+ long method, including one “for” loop, at least 5 places where the code repeats, but not completely, unused logic, incorrect comments, while (true), and increasing the “for” counter in the body of the loop to look forward to the list of arrays. In principle, we hope that the client does not notice what is happening, and if they do, we can fix it when they whine.

+4
source share
1 answer

The usual approach:

  • " git init " directly in the directory in which you want to manage locally
  • add .gitignore so as not to add any data or directory specific to VCS
  • git add .gitignore and commit
  • git add .
  • commit

This way you have a local repo that you can then clone, create branches, patches, ... (I do this for ClearCase views for example )

A similar approach with similar commands is valid, of course, with Hg Mercurial.

+2
source

Source: https://habr.com/ru/post/1303438/


All Articles