When I work with other people, I often like to take a look at what they've done so far or I would like to let them know what I've been doing.
Let me note that in such a state, the code may be unusable in a way that a new feature disturbs something and I am just trying to figure out how to resolve this, so the commit itself might not be “finished”.
Is there any efficient way of giving them a possibility to view my commits without having to create a new remote branch?
A Remote branch has severe disadvantages for this task, because
git rebase --interactive
or do amend committingIf what you want to provide is read-only access or some other kind of access control, you probably want to look into repository browsing/management software.
However, if you are sharing your work with a trusted user, you can ask them to create new remotes. This fulfills your #1 and #3 desires of not polluting your origin
with extra branches.
Given you are a-host
and you want to share your my-repo.git
with b-host
, a user on b-host
can do the following:
b@b-host$ git remote add wip git-user@a-host:/my-repo.git
b@b-host$ git remote show
origin
wip
b@b-host$ git checkout wip/master
Beware that user b@b-host
can write to your local(on a-host
) repository in this case, because you must necessarily have granted it access to some git-user
on your machine.