Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Only-Pull-from-Parent (with Rebase) and Only-Push-to-Origin (with Force)

Sourav Kumar Sahu October 28, 2019

Also let me know if we can configure Only-Pull-from-Parent (with Rebase) and Only-Push-to-Origin (with Force), without having the risk of accidental Pull/Push to the wrong repository

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2019

Hello @Sourav Kumar Sahu,

I'm not quite sure what constraints you want to set up and where, please elaborate on your use case.

On Bitbucket side you might make use of branch permissions (and obviously repository permissions).

Hope this helps.

Cheers,
Daniil

Sourav Kumar Sahu October 28, 2019

Hi @Daniil Penkin ,

 

I have Parent repo and 2 forks Origin-pc1 & Origin-pc2. These forks are cloned into 2 different Local PCs. 

 

Now i want to configure

1) Only pull-rebase from Parent to Local

2) Only Force-push from Local to Origin

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2019

Ok, I think I got you.

So the configuration you're after is client-side, e.g. you'll have to configure Git clients on those local PCs.

  1. You might want to configure different fetch and push URLs (former used when pulling). Basically, you clone a repo from Parent (or set its URL via CLI), then update the push URL  to point to the relevant Origin (specifically, take a look at --push option of git remote set-url command).
  2. Configure Git client to pull with --rebase option. You might want to set an alias for that.
  3. Configure Git client to force push (although I'd suggest to go with --force-with-lease instead).

You might also want to restrict Parent from being modified in any way other than Pull Requests (again, you can do that with repository permissions and/or with branch permissions).

Hope this answered your question.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events