How to fork your own repo on BitBucket ?
I know how to fork another user repo from web interface, and I know how to clone my repo.
But how to fork your own repo on BitBucket and ease a future pull request workflow?
Go to your repository, and then go to Actions -> Fork.
If you have the new navigation enabled, then go to your repository, click on the + on the left navigation bar and then Get to work -> Fork this repository.
Also, make sure that forking is enabled in repository settings (for the existing repository).
First, create a new repository 'bar'. Next, clone the existing project 'foo':
$ git clone [email protected]:YOURNAME/foo.git bar
Next, edit your Git config file and replace the origin URL with your new URL:
$ cd bar
$ vim .git/config
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:YOURNAME/bar.git #replace foo with bar
Optionally add your original repo as an upstream source:
$ git remote add upstream [email protected]:YOURNAME/foo.git
Finally, push your new repository up to Bitbucket:
$ git push -u origin master
Now you can push/pull from your new repo (bar) as expected. You should also be able to merge upstream changes using the following command:
$ git fetch upstream
$ git merge upstream/master
credit: bitdrift
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With