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
    There is no upgrade path directly from 16.04 to 22.04 - for any flavor. Unless you do a piecemeal hop (16.04 which is EOL -> 18.04 -> 20.04 -> 22.04) which increases the percentage of hard fail exponentially with each hop, you will need to clean install, which means your home directory, files, etc. will NOT be kept in the installation. If you intend to go to 22.04, you need to backup your files and your home directory into external media (SEPARATE from installer disk!) so you can keep all the files you want to keep, clean install, then restore your data after the fact from the external media, – Thomas Ward Aug 01 '22 at 05:42
  • Ubuntu 16.04 LTS had two upgrade paths, (a) to the next release (16.10) but that disappeared when 16.10 reached EOL, and to the next LTS release (ie. 18.04). There is no upgrade path direct to 22.04 LTS. – guiverc Aug 01 '22 at 05:43
  • 2
  • 1
    FYI: I'm involved in QA testing, and an upgrade via re-install is a common QA-test, where I perform a re-install & all manually installed packages from Ubuntu repositories get auto-reinstalled, and no user file is touched; however QA-testing involved only Ubuntu repository software (that exists in the old & new release) and not 3rd party packages. That does allow skipping releases - however as it's not QA-tested for all packages; it's up to the person who wants to use it to ensure the programs/data they rely on can deal with the jump between releases. – guiverc Aug 01 '22 at 05:46
  • 1
    Also don't forget Ubuntu-MATE 16.04 reached EOL in 2019-April (3 years after release), so changes made after that date will not have considered the EOL product. Five years of supported life applies to packages from 'main' such as Ubuntu Desktop, Ubuntu Server, Ubuntu Core... but not flavor or community packages. – guiverc Aug 01 '22 at 05:53
  • Doh, just realized it was 18.04 and not 16.04. Not sure why I keep getting that wrong. I'm checking out the different links - thanks for sharing – Cardio Leo Aug 01 '22 at 10:25
  • Ubuntu-MATE 18.04 has the same two upgrade paths; (1) to the next release which was 18.10, or (2) to the next LTS release which is Ubuntu 20.04 LTS. You can release-upgrade from 18.04 to 20.04 LTS, after reboot (& if it was me validating the release-upgrade all went well), you can release-upgrade again to 22.04 LTS though this step currently isn't open so will need to be forced. Ubuntu 20.04 LTS to 22.04 LTS upgrade opens after the release of 22.04.1 LTS which currently is in RC (release candidate), with the upgrade opening after it's release (ie. next week at earliest..) – guiverc Aug 01 '22 at 11:52

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
  • 114,770
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,026
  • 1
    Thanks a bunch - I learned from the other answer, but this really got to the point of my question. I appreciate it. – Cardio Leo Aug 06 '22 at 10:41