Forking to Bitbucket

I would like to do some experimental coding but need to work on more than one machine. I know dropbox and iCloud do not play well with git so really I need my code to be in a cloud repo. I happen to use Bitbucket.

Clearly an official blender developer does not have this problem they just create a branch in github and regularly push.

I have done some googling and I think my use case can be achieved if I when creating a Bitbucket repo I create a fork of the blender code in github. I can then clone that to my local machine and push my code. I can on Bitbucket pull updates from github.

Anyone using this workflow? Am I on the right track?

Thanks.

I’m not sure how GitHub came into your equation, but indeed: anyone can fork Blender anywhere. The main repository is of course at https://developer.blender.org/diffusion/B (or more specifically git://git.blender.org/blender.git ). You’ll have the main repository as a separate remote that you could call say upstream. Your own repository at BitBucket would be at your origin. Take care to work always in (feature/fix) branches, not in master nor in any of the stabilizing branches (currently blender-v2.81-release).

Create your own branches from the branch you want to work with. Regularly fetch upstream and merge in your origin/master and origin/blender-v2.81-release to keep your own fork up to date. And merge from those into your own feature/fix branches.

You can create diffs from your branches with upstream and submit them on https://developer.blender.org .

3 Likes

Thanks, that is very helpful - I can give that a go at the weekend. Ignore me saying github that was just a slip of the tongue!

The GitHub help pages have quite useful info on how to do forks and keeping them synced. I don’t know if BitBucket has those (I guess they do), but in case they don’t check the GitHub help pages on forks.

Found a straightforward account here: https://stackoverflow.com/questions/46691186/how-to-clone-a-project-from-github-but-use-bitbucket-as-remote-repository.

Spoke too soon.

$make update

has problems doing git submodule update. Seems it is going to the wrong repo. Time to read git manual!

Ok think I fixed it:

$git clone http://git.blender.org/blender.git
$git submodule init

then

$git remote rename origin upstream
$git remote add origin bitbucket url
$git push -u origin master
$make update
$make full

Note that this way you still have all submodules referencing the ones on on developer.blender.org. That is ok, if you don’t need to commit to any of these, but a full fork would mean also forking these submodules :slight_smile: