Currently my friend and I are using sharing VM and are using git to keep track of changes. A problem occurs when he tries to commit since the VM is under my name. Since the VM is mine and the git repo has been established with my name, bitbucket (an online git repository) thinks im the user thats pushing the code them and registers it under my name although my friend is using his personal remote. So is there a way for both of us to share a database for development purposes without having to share a VM or is there a way to switch users in git instead? I need to find a way for my friends commits to be registered as his own for tracking purposes.
P.S. I think I need to make it clear that we are both currently using the same machine but even when he pushes code using his remote url, bitbucket registered the commit as my own.
the only reason he is still using my VM is the fact that we are noobs and dont know how to share a database while he works and commits from his own VM
The simplest way is for your friend to edit code in his own folder. It may feel like you're wasting disk space but all other solutions require even more disk space. This way, you don't need another VM or even another user account on your VM.
git clone
the repo again into another folder:Configure the
.git/config
file inside the folder correctly so that commits made in this folder will belong to your friend. You can use thegit config
command for this. Just don't use the--global
flag.Have your friend use this folder to do his edits.
Pull and push code to bitbucket to synchronize your work. This simulates two developers working on two different PCs.
The advantage of this setup is that it familiarizes you to pulling and pushing code (and merging). Later when you have separate PCs to do development you don't have to change your habits.
Hint: Google
"git flow"
for a nice setup/workflow for projects with multiple developers.