Here’s an example of how to do this on Bitbucket: Manually create a Git fork. I may use their command line API to fork a project on Bitbucket, but I need to at least read the root project permissions.
Here's the syntax:
curl -v --user {username}:"{password}" \
https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/fork \
--data "name=mynewrepo"
To fork Project A from an account B to my account C with the name Project D, I will use the following command:
curl -v --user XYZ:"XYZPASSWORDXYZ" \ https://bitbucket.org/api/1.0/repositories/ABC/ProjectABC/fork \ --data "name=ProjectXYZ"
Now, I will clone this project to my local machine, git clone [project]
I will go to my project directory and add remote upstream which will point to the source repository: git remote add upstream [git]
Now, at anytime to pull the changes from source repository (say from master branch), I will use: git pull upstream master and to push my local commits to my target repository on server, I will use: git push origin master
And when your changes on target repository are ready to be merged with the source repository, create a Pull Request either from Bitbucket website or using Bitbucket API: Pull Request
However, if you will calculate your time doing this stuff, it can take 30 seconds to 2 minute if you have slow system. My point is, is there a way to send Pull Request using only 1 command that will do it all without all this stuff?