Hi Euler,
Unfortunately, Git questions are extremely difficult to give accurate answers on, as how you are using Git can differ (there are many different strategies that different institutions use based on their one preference/needs).
Just *one* strategy (that I've seen used) is to create your own custom branch for your site and merge in new versions of the DSpace code when doing an upgrade. In this strategy, you'd do something like:
1) Start your custom branch (named "mysite" in this example) from the DSpace v6.1 tag on a custom fork of the DSpace/DSpace repository, e.g.
git checkout -b mysite dspace-6.1
2) Then make any changes to the "mysite" branch that you need. Doing a "git commit" for each.
3) When it's time to upgrade, merge in the new release of DSpace (in this case the DSpace v6.3 tag), e.g.
git checkout mysite
git merge dspace-6.3
The merge here might create merge conflicts (if you've changed files also changed in the new release). So, you may need to work through merge conflicts file by file before you can commit the changes back to your "mysite" branch. It's also possible to use
"git diff" commands to see the differences before doing a merge, e.g.
git diff dspace-6.1..mysite (see changes between mysite and v6.1, to see what you've customized)
git diff dspace-6.1..dspace-6.3 (see the changes in DSpace between v6.1 and 6.3)
I don't have any advice on doing this in IntelliJ, as I'm a novice with IntelliJ. Maybe others can respond to that though, if they use IntelliJ to help with managing their code in Git.
As for why your site is still installing 6.1 instead of 6.3, that's really hard to say. My best guess is maybe one (or more) of your POM files (pom.xml) still reference 6.1 (so that the JARs that end up in [dspace]/lib/ and in webapps are still v6.1 JARs
instead of v6.3). I'm not sure how that would have occurred though, but you should check whether the "dspace" JAR files have a version of 6.1....if so, then something went wrong in your last Git merge when you tried to upgrade to 6.3.
Tim