Re: Easy Non-Fast-Forward Pushes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

> So maybe you create a bash alias for
> alias gitup='git push origin HEAD:${USER}/$(date -Iseconds)'
> which would push your current tip of the repository to the remote with
> quite a unique name.
>
> Then you could also do a "git commit -a && gitup" to push your changes
> to the server
> As the integrator you could then integrate branches with
>     "git fetch origin && git merge origin/sbeller/2015-02-27T09:34:47-0800"
>
> So it is doable. Though I am not convinced of the workflow.

This solution is not too bad, I thought, but there should be a way to
remove those branches once I have integrated them. Otherwise the
repository might get cluttered, and I found that those branches are
particularly annoying when viewing a graphical representation of the
commit graph.

Deleting is possible, using 'git push origin :BRANCH'. But then, anyone
with pushing capabilities could do this! I don't like the possibility of
one team member messing up another's commit, be it on purpose or
accidentally.

In Gitlab, branches can be protected. For this to work, however, I would
need fixed names. So I would assign one branch to each team member, make
those branches (let's call them "personal branches" for now) protected,
and then configure their systems (by shell aliases, scripts, ...) to the
following:

1. Try pushing to origin/master. If it works, fine. If not, goto 2.

2. Push to the appropriate personal branch.

This system does not prevent someone pushing to another's personal
branch, thereby possibly making a fast-forward push impossible. So step
number 2 may fail due to this, but this might be an acceptable risk.

Thanks a lot for your thoughts.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]