2

I am using Mplab X IDE ver 5.45 user graphical interface for for versioning in Git. When I want to checkout a particular commit the menu gives the option "Checkout revision" or "Checkout files". Could someone please explain which is the difference? (I am not expert in Git).

Moreover: is there any kind of CLI console in Mplab to give git commands and read git messages?

Thanks for the attention.

Guille
  • 326
  • 2
  • 10
  • 2
    I don't know what Mplab is, and I do not recommend letting a GUI get between you and Git. But the difference between a "revision" (commit) and a file is pretty clear; this is just the overloaded nature of `git checkout`. See the docs, https://git-scm.com/docs/git-checkout, which actually start by pointing out this double nature of `checkout`. Personally I literally never use `git checkout` for _anything_ any more, exactly because it is so overloaded (and dangerous); I use `git switch` and `git restore` to do those different jobs. – matt Jul 27 '22 at 09:42
  • 2
    Anyway, "When I want to checkout a particular commit" means "Checkout revision" is what you want; a revision is a commit. Stay away from "Checkout files" unless you know what you're doing. – matt Jul 27 '22 at 09:46

1 Answers1

0

The MPLAB® X Integrated Development Environment (IDE) thread suggests:

  • checkout files restores files at the current revision (equivalent to git restore)
  • checkout revision switches to a given project revision (equivalent to git switch)

However, that same thread mentions (in 2017, so it might have changed):

Probably the single biggest problem I have found so far is that if you use "Check out" in MPLAB it does not currently "flush" and reload the configuration files.

The changes made by Check-out can even hang the IDE.
When winding back to earlier versions this makes it retain bits of newer version configurations such as source file names that don't exist yet.

It seems as if you must close the project and check out with an external git such as git_gui to get configurations to reload properly.
Checking out lesser revisions that don't change configuration will work fine, though.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250