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

fork a repo in bitbucket using bash

Charlie September 14, 2019

Hi all,

I can fork a repo using web GUI of bitbucket, it is straight forward.  But, I want to do the operation in bash.  Is there a way?

 

Thanks.

1 answer

1 accepted

2 votes
Answer accepted
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 14, 2019

@CharlieFork is not standard Git or Command Line operation, so in simple words no you can't fork any repository using terminal.

But, once you have forked a repository, or you have cloned it in your local you can run git workflow using command line.

You can read this guide to maintain sync with upstream after fork using command line - https://www.atlassian.com/git/tutorials/git-forks-and-upstreams

Charlie September 17, 2019

@DPKJ , 

it is not true.  One of the member here suggested that I can fork using command line.

The post is here:

https://community.atlassian.com/t5/Bitbucket-questions/How-can-I-fork-a-private-bitbucket-repository-like-github/qaq-p/1171071?utm_source=atlcomm&utm_medium=email&utm_campaign=mentions_reply&utm_content=topic

At the end of the post, she mentioned about how to do it with command line.

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 17, 2019

@Charliewhat here suggested is REST API. If you are comfortable using that, like with curl etc. you can do that.

curl -X POST -u <USERNAME> https://api.bitbucket.org/2.0/repositories/<REPO_USER>/<REPO_NAME>/forks

This is not command line but assessing using rest interfaces.

Charlie September 17, 2019

@DPKJ ,

As long as I can write a command in a bash script to carry out the operation, and yes, that is what I am after.

Since you also tend to give me to the 'curl' command, I will give the credit to you.

Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events