I'm in an interesting situation with source control in a current project, and I'd like people's opinions on it.
The setup: we use VSTS with a git repo. I'm using Visual Studio as my IDE, and my colleague is using Intellij (long story). I use the git integration in VS to handle my commits, while he does things from the commandline. So I'm a noob, sue me.
I encountered a weird problem when I tried to merge my pull requests into the master. The first PR would succeed, but subsequent PRs from the same branch would almost always run into file conflicts. These would always be the same files as I'd changed the first time; there were no issues with other people updating the repo.
We think it's because of the fact that he's enabled a policy to always force merges into the master to be squashed. What happens is that after my first (successful) merge, the history for the master will contain a single squashed commit, while the history for my branch will still have all the original commits. In particular, the SHA hash for the squash will be missing from the list of SHAs for my branch; and the upshot is that VSTS thinks my branch is now one update behind. This makes things go out of sync, and future merges will tend to fail.
This is the first time I've seen people use squashed commits when working with git. He claims that it's necessary to keep attributions straight when you have multiple overlapping commits from different people, but it sounds a bit dubious to me.
Is this a recommended practice? Does the fact that we're using VSTS and not GitHub/Bitbucket/whatever make a difference?
A kind-of related issue is that he works on a local copy of the master, and pushes to a new branch on the origin; whereas I create a new local branch and push to the same branch on the origin. This lets him avoid the problem, but I'm not sure if pushing to a different remote branch is possible with VS.
Got an email from him, it turns out he's really more of an SVN guy. But one point that he raised does seem pertinent: rolling back a big PR, that's made up of several small commits. This would be straightforward if the PR is a single squash, but less so otherwise.
The setup: we use VSTS with a git repo. I'm using Visual Studio as my IDE, and my colleague is using Intellij (long story). I use the git integration in VS to handle my commits, while he does things from the commandline. So I'm a noob, sue me.
I encountered a weird problem when I tried to merge my pull requests into the master. The first PR would succeed, but subsequent PRs from the same branch would almost always run into file conflicts. These would always be the same files as I'd changed the first time; there were no issues with other people updating the repo.
We think it's because of the fact that he's enabled a policy to always force merges into the master to be squashed. What happens is that after my first (successful) merge, the history for the master will contain a single squashed commit, while the history for my branch will still have all the original commits. In particular, the SHA hash for the squash will be missing from the list of SHAs for my branch; and the upshot is that VSTS thinks my branch is now one update behind. This makes things go out of sync, and future merges will tend to fail.
This is the first time I've seen people use squashed commits when working with git. He claims that it's necessary to keep attributions straight when you have multiple overlapping commits from different people, but it sounds a bit dubious to me.
Is this a recommended practice? Does the fact that we're using VSTS and not GitHub/Bitbucket/whatever make a difference?
A kind-of related issue is that he works on a local copy of the master, and pushes to a new branch on the origin; whereas I create a new local branch and push to the same branch on the origin. This lets him avoid the problem, but I'm not sure if pushing to a different remote branch is possible with VS.
Got an email from him, it turns out he's really more of an SVN guy. But one point that he raised does seem pertinent: rolling back a big PR, that's made up of several small commits. This would be straightforward if the PR is a single squash, but less so otherwise.