Sharing+Jetstream+Code+via+Bitbucket

Click here to return to top level Code Management page.

Suppose that one day at lunch Jenmy tells Shahriar that she has just added a really cool new feature to her local Jetstream repository that Shahriar might be interested in using. The following procedure describes how code developers within the group can share code amongst themselves.

Push the branch containing the new feature to bitbucket
1. Jenmy begins by pushing the branch with her new feature from her local repo on SciNet to her public repo on bitbucket. Note that "origin" is the default name of the GIT remote pointing to Jenmy's public repo on bitbucket. code gpc-f101n084-ib0-$ git branch master new-snopt tmp working
 * jenmys_cool_new_feature

gpc-f101n084-ib0-$ git push origin jenmys_cool_new_feature code After Jenmy has made her new feature branch available on her public repo on bitbucket, she tells Shahriar to go and get it!

Add a shortcut for sharing with a developer in the group
In this situation, a GIT "remote" can be considered a link to someone elses public repo on bitbucket for pulling changes. Shahriar would add a remote to his local repo to get Jenmy's latest code feature: code gpc-f101n084-ib0-$ git remote add jenmy git@bitbucket.org:jenmy/jetstream.git code

Create a branch to accept the new feature from Jenmy, then pull from Jenmy's public repo
The following commands create a branch on Shahriar's local repo named "jenmys_cool_new_feature", then switch to that branch, then pull from Jenmy's branch of the same name on her public repository on bitbucket code gpc-f101n084-ib0-$ git branch jenmys_cool_new_feature gpc-f101n084-ib0-$ git checkout jenmys_cool_new_feature gpc-f101n084-ib0-$ git pull jenmy jenmys_cool_new_feature code