FYI, I'm pretty new to git, using mostly gitgui.
When I change the name of an already tracked folder containing already tracked files in my project, git sees all the files in the folder as new untracked files. How do I make git understand that I only changed the name of the folder, so that I don't "lose" the history of the files contained in that folder?
Git doesn't care about your files or folders. There I said it. It tracks your content. After you move your files it'll show in git status as deleting a set of files/folders and a creation of files/folders. After your commit Git will detect that it's already seen this exact content and be able to follow not only the "files" and "folders" but even if you moved code from one file to another by the way it manages chunks.
Welcome to Git!