>>> "KK" == Konstantin Khomoutov <kos...@bswap.ru> writes:

> On Fri, Dec 09, 2022 at 07:59:52PM +0100, Uwe Brauer wrote:
> [...]
>> (hg) push -f 
>> 
>> That is a forced push, github and bitbucket accept that, while gitlab tells 
>> me 
>> 
>> abort: pushing refs/heads/main overwrites d30105a181c4

> This stuff is configurable in GitLab, and I suspect that's what you're
> encountering.

Right! Thanks so much

> In the Settings -> Repository panel, there are sections named "Protected
> Branches" and "Protected Tags", and I think GitLab has "master" protected from
> force-pushes by default.


I have to say that this configuration planel is not as clean as the one
of github, especially since it is not clear whether the 

allow forced pushed  option enabled is saved

So I run a test and indeed now it works!

> The reasoning is that in a typical enterprisey workflow you never has a need
> to overwrite master (and in a shared repository with many developers that's
> almost always a bad idea anyway): mostly because you do all the normal work on
> side branches, which you can overwrite at will, and they are merged to master
> when they are ready. Even if a branch was merged by mistake, you usually
> "unmerge" it by reverting that change (what `git revert` would do) which
> creates another commit, so, again, no need to force-push anything.

Yes I know, it is a «method of last resort» but the point is if I do
this the student who will pull needs to have 

[pull]
        rebase = true

In his configuration.


I think right now the best solution is the following

    1. I set up a repository in gitlab/github/bitbucket, the student
       will chose which he wants to use.

    2. The default git  branch (not protected) I will call «default» not
       master nor main, because

       a. this is the well default branch for hg (called master or main
          in git)

       b. and all commits imported from git into hg, end up on the default
          branch with a bookmark corresponding to the git branch. There
          is a trick not to run into a conflict.

    3. The student will fork the repository where he/she works commits
       etc, if he/she wants my help, he/she needs to invite me, and I will
       clone commit and push (not sure whether I will create a new
       branch, most likely not)

Regards and thanks 

Uwe Brauer 


> See [1] for more info.

>  1. https://docs.gitlab.com/ee/user/project/protected_branches.html

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87mt7v0vuc.fsf%40mat.ucm.es.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to