I am a C# developer and trying to figure out Git. It's a much different environment than what I am used to in a centralized VCS (I am very comfortable with TFS). I've watch some excellent Pluralsight videos on Git and went through tutorials and feel confident in basic Git functionality, however I think I am missing something fundamental regarding merging/rebasing.
I have forked and modified mediawiki quite a bit as well as some of its extensions (forked those as well and repointed my .gitmodules to point at my forked version). I currently have 1.22.5 (corresponds to branch REL1_22) deployed to production and is where I have made all my changes. I have also commited my submodule changes. These changes prompt another change in the main repo to repoint the submodule references to point to the new commits.
Here's the part that escapes me. Suppose I want to reproduce my changes in master. In TFS, each branch in separate directories. When you merge, all of your code is duplicated in the other directory, deal with conflicts and check in. With Git, I switch branches with git checkout master
leaving me in the same directory (though I understand that Git restores the snapshot that the destination branch is pointing to, adding/removing files and folders as necessary). At this point, how do I merge just my changes for submodules+main? Do I use git merge <SHA-1>
to merge specific commits in my submodules, then git merge
again in the main project (with updated submodule reference SHA-1s)? Is there a cleaner way to wrap everything up in one branch and merge just that branch to master (and other release branches)? Maybe git rebase
is what I am looking for, to replay all my changes on another branch?