Reputation: 63
I want to push my commits to another git user (it is local development server that need t be a user not a git server) Is it possible to push to another git user? If yes then how?
Upvotes: 2
Views: 132
Reputation: 2285
Since you are trying to push to another user, its a push to a non bare repo, which is not preferred. You can do one of these to do the task.
I hope this will solve the problem.
Upvotes: 0
Reputation: 1323553
If your user u1 can access the directory where u2's repo is, through a shared path, then:
# u2 cd /path/to/parent/directory/of/repou2 git clone --bare repou2 barerepou2 cd /repou2 git remote add barerepo ../barerepou2
git remote add repou2 /shared/path/to/u2/barerepo
git push repou2 master
git fetch barerepo
See "Git push only for bare repositories?" on the importance of pushing to a bare repo instead of directly repou2 repo.
Upvotes: 3