0

a fairly basic question. I know that in general when you update Ubuntu distros, your files are saved. My question is specifically about git files. Do they have to be reinitialized or what is the process for making sure they are recognized by git on my local machine after upgrading Ubuntu distros?

I have 16.04, I believe, and am wanting to upgrade to 22.04 Ubuntu Mate. Not sure it matters.

2 Answers2

3

Upgrading from Ubuntu 16.04 to Ubuntu 22.04 is a long, complicated upgrade and it involves some risk, especially if you decide to skip releases when upgrading. For this reason you should back up all files that you wish to keep before starting the upgrade to Ubuntu 22.04, including your git files.

You can also run an Ubuntu 22.04 live session from an Ubuntu 22.04 live installation USB to make sure that your git files will be recognized by Git on your local machine after upgrading to Ubuntu 22.04.

karel
  • 122,292
  • 133
  • 301
  • 332
1

Always take a backup before doing anything major. Also, you seem to be jumping a long release train. Either do an incremental upgrade as suggested in comments, or I'd personally recommend a fresh install.

Now that being said, files are file, regardless if they are git files, images or PDF. As long as you are keeping file in your home directory, or a separate partition, or anywhere else which is not considered a system directory, they should be safe.

For OS, a file is a file with some data in it. It is up to the program to make sense out of that data. git will understand files in a .git/ directory, and an image viewer will understand based on bit pattern in the file's preamble/header or file extension.

The OS doesn't care about what file types they are, and it wont touch them as long as they are outside system directories.

Do they have to be reinitialized or what is the process for making sure they are recognized by git on my local machine after upgrading Ubuntu distros?

No, you don't have to reinitialize anything. If you preserve your directory structure, you'll have .git directory in each of your projects, which is used by git to track.

Make sure that after update the following command work, if not then you have to reinstall git binaries (which I don't think will be a case you'll encounter)

git --version
BhaveshDiwan
  • 11,506
  • 10
  • 35
  • 46