I have previous experience using GIT in other development environment and I never had much troubles using it.
We where using SVN for salesforce, however we want to migrate to GIT for the uncountable number of advantages compared to SVN.
I could configure the remote and local repo without any problem and also I could commit and push the changes to my remote repo.
However, I can't figure out how can we use GIT when more than one developer is doing changes on the repo. I always get conflict after refresh from server.
Sample where bought dev's are working on the same repo/branch
Dev 1:
- Refresh from Server
- Change code
- Save to Salesforce
- Commit
- Push to remote
After Dev 1 pushing
Dev 2 (Steps A):
- Refresh from Server
- Change code
- Save to Salesforce
- Commit
- Push to remote (Error: out of date)
- If dev 2 try pull (or fetch + merge) then Conflict
Other steps we tried Dev 2 (Steps B):
- Refresh from Server
- Pull (or fetch + merge) then Conflict
I was thinking in the possibility to use two branches: one for dev, just to be able to push commits to remote repo and the merged code will come always from Salesforce. But this practice will kill some of the GIT benefices as diff and blame.
I've tried searching on Google unsuccessfully.