Skip to content

Instantly share code, notes, and snippets.

@chandrahasan1
Forked from rosswd/multi-git-win.md
Last active August 29, 2015 14:21
Show Gist options
  • Save chandrahasan1/9cfbdc49c79b3664b329 to your computer and use it in GitHub Desktop.
Save chandrahasan1/9cfbdc49c79b3664b329 to your computer and use it in GitHub Desktop.

Revisions

  1. @rosswd rosswd revised this gist Feb 4, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion usage.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## Using new dual setup
    *This guide assumes you have followed `multi-git.md` and set up both accounts.
    *This guide assumes you have followed `multi-git.md` and set up both accounts.*

    ### Github (default)
    Create a repo online called testmulti (or one of your choosing), then in Terminal,
  2. @rosswd rosswd revised this gist Feb 4, 2015. 2 changed files with 86 additions and 83 deletions.
    85 changes: 2 additions & 83 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -32,9 +32,9 @@ Paste into text area, under ssh settings, in your github or bitbucket account.
    Also give the ssh key a title like "your name" Laptop.

    ## Create Config file
    I am using macvim, alias mvim, enter your editor here if different:
    I am using vim, enter your editor here if different:

    `mvim ~/.ssh/config`
    `vim ~/.ssh/config`

    Create your git aliases like so:

    @@ -71,84 +71,3 @@ Check keys were added:
    ssh -T gh
    ssh -T bb
    ```

    ## Test repositories

    ### Github (default)
    Create a repo online called testmulti (or one of your choosing), then in Terminal,
    create your repository:

    ```shell
    mkdir ~/testmulti
    cd ~/testmulti
    touch readme.md
    git init
    git add .
    git commit -am "first commit"
    git remote add origin git@gh:username/testmulti.git
    git push origin master
    ```

    Add some text to readme on github.com, then:

    ```shell
    git fetch origin master
    git diff master origin/master
    git merge origin/master
    git push origin master
    ```

    ### Bitbucket (secondary)
    Create a repo online called testbucket and then in Terminal:

    ```shell
    mkdir ~/testbucket
    cd ~/testbucket
    touch readme.md
    git init
    ```

    *This being the secondary account, the username and email have to be
    overwritten, using secondary account values, at the repo level:*

    ```shell
    git config user.name "Full Name"
    git config user.email email_address
    ```

    This must be done **once** for every *bitbucket* (or secondary) repo, it is not
    needed for github (or primary) repos because the global is used in that scenario.
    There may be a cleaner way to do this but right now it works okay.

    ```shell
    git add .
    git commit -am "first commit"
    git remote add origin git@bb:username/testbucket.git
    git push origin master
    ```

    Add some text to readme on bitbucket.org, then:

    ```shell
    git fetch origin master
    git diff master origin/master
    git merge origin/master
    git push origin master
    ```

    ## Use case: Repo already exists on secondary remote repo (bitbucket)
    So you have a repository that already exists and you want to want to `clone` it
    but also you want to make sure when you `push` it, the correct user, the bitbucket
    user pushes. Let's say the repo is called `booker`.

    ```shell
    git clone git@bb:bb_username/booker.git
    git config user.name "bitbucket user name"
    git config user.email email_address
    ```

    Remember, because we are using the secondary account, we have to over-ride the global configuration of username and email. The git clone command is using the ssh keyfile you set up earlier and is doing the transfer over ssh.

    Now, change into the cloned directory and modify one of the files. Use `git status` to check the current state, then use `git add 'filename'` and `git commit -m "commit message"`.

    Finally push your changes using `git push origin master`.
    84 changes: 84 additions & 0 deletions usage.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,84 @@
    ## Using new dual setup
    *This guide assumes you have followed `multi-git.md` and set up both accounts.

    ### Github (default)
    Create a repo online called testmulti (or one of your choosing), then in Terminal,
    create your repository:

    ```shell
    mkdir ~/testmulti
    cd ~/testmulti
    touch readme.md
    git init
    git add .
    git commit -am "first commit"
    git remote add origin git@gh:username/testmulti.git
    git push origin master
    ```

    Add some text to readme on github.com, then:

    ```shell
    git fetch origin master
    git diff master origin/master
    git merge origin/master
    git push origin master
    ```

    ### Bitbucket (secondary)
    Create a repo online called testbucket and then in Terminal:

    ```shell
    mkdir ~/testbucket
    cd ~/testbucket
    touch readme.md
    git init
    ```

    *This being the secondary account, the username and email have to be
    overwritten, using secondary account values, at the repo level:*

    ```shell
    git config user.name "Full Name"
    git config user.email email_address
    ```

    This must be done **once** for every *bitbucket* (or secondary) repo, it is not
    needed for github (or primary) repos because **the global is used** in that scenario.
    There may be a cleaner way to do this but right now it works okay.

    Just to be clear you do not need to change these values back afterwards because the
    global values (which apply to all future repos created) will be set.

    ```shell
    git add .
    git commit -am "first commit"
    git remote add origin git@bb:username/testbucket.git
    git push origin master
    ```

    Add some text to readme on bitbucket.org, then:

    ```shell
    git fetch origin master
    git diff master origin/master
    git merge origin/master
    git push origin master
    ```

    ## Use case: Repo already exists on secondary remote repo (bitbucket)
    So you have a repository that already exists and you want to want to `clone` it
    but also you want to make sure when you `push` it, the correct user, the bitbucket
    user pushes. Let's say the repo is called `booker`.

    ```shell
    git clone git@bb:bb_username/booker.git
    git config user.name "bitbucket user name"
    git config user.email email_address
    ```

    Remember, because we are using the secondary account, we have to over-ride the global configuration of username and email. The git clone command is using the ssh keyfile you set up earlier and is doing the transfer over ssh.

    Now, change into the cloned directory and modify one of the files. Use `git status` to check the current state, then use `git add 'filename'` and `git commit -m "commit message"`.

    Finally push your changes using `git push origin master`.
  3. @rosswd rosswd revised this gist Oct 24, 2014. 2 changed files with 6 additions and 8 deletions.
    12 changes: 4 additions & 8 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -26,10 +26,10 @@ pbcopy < ~/.ssh/id_rsa.pub
    pbcopy < ~/.ssh/id_rsa_bb.pub
    ```

    *Obviously run each `pbcopy` command individually.*
    Obviously run each `pbcopy` command **individually.**

    Paste into text area, under ssh settings, in your github or bitbucket account.
    Also give the ssh key a title like Ross' Laptop.
    Also give the ssh key a title like "your name" Laptop.

    ## Create Config file
    I am using macvim, alias mvim, enter your editor here if different:
    @@ -85,7 +85,7 @@ touch readme.md
    git init
    git add .
    git commit -am "first commit"
    git remote add origin git@gh:rosswd/testmulti.git
    git remote add origin git@gh:username/testmulti.git
    git push origin master
    ```

    @@ -98,10 +98,6 @@ git merge origin/master
    git push origin master
    ```

    If your puzzled why I didn't just do a `git pull` above, it's because I like to
    compare before I merge. I have had quite a few disasters doing a straight pull
    and thinking it will merge perfectly, don't do it.

    ### Bitbucket (secondary)
    Create a repo online called testbucket and then in Terminal:

    @@ -127,7 +123,7 @@ There may be a cleaner way to do this but right now it works okay.
    ```shell
    git add .
    git commit -am "first commit"
    git remote add origin git@bb:rosswd/testbucket.git
    git remote add origin git@bb:username/testbucket.git
    git push origin master
    ```

    2 changes: 2 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # Setting up a seperate Github and Bitbucket account

    *NOTE: THIS GUIDE WORKS AS OF JAN 9 2014.*

    If you want to have private repositories at Bitbucket and public repositories at
    Github, then this is the guide for you.

  4. @rosswd rosswd revised this gist Jan 9, 2014. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    # Setting up a seperate Github and Bitbucket account

    If you want to have private repositories at Bitbucket and public repositories at
    Github, then this is the guide for you. Your life is obviously simpler if you can
    afford Github but I cannot afford it and so this guide was created.
    Github, then this is the guide for you.

    This guide assumes:

  5. @rosswd rosswd revised this gist Dec 17, 2013. 1 changed file with 27 additions and 13 deletions.
    40 changes: 27 additions & 13 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -3,17 +3,20 @@ Github will be the main account and bitbucket the secondary.

    ## Create SSH Keys

    ```shell
    ssh-keygen -t rsa -C "github email"
    ssh-keygen -t rsa -C "bitbucket email"
    ```
    `ssh-keygen -t rsa -C "github email"`

    Enter passphrase when prompted. If you see an option to save the passphrase in
    your keychain, **do it** for an easier life.

    Save keys to:

    `~/.ssh/id_rsa`
    `~/.ssh/id_rsa_bb`

    Repeat for bitbucket:

    `ssh-keygen -t rsa -C "bitbucket email"`

    Save bitbucket key to `~/.ssh/id_rsa_bb`

    ## Attach Keys
    Login to remote repo and add ssh key:
    @@ -23,14 +26,18 @@ pbcopy < ~/.ssh/id_rsa.pub
    pbcopy < ~/.ssh/id_rsa_bb.pub
    ```

    Paste into text area under ssh settings in your github or bitbucket account.
    *Obviously run each `pbcopy` command individually.*

    Paste into text area, under ssh settings, in your github or bitbucket account.
    Also give the ssh key a title like Ross' Laptop.

    ## Create Config file
    I am using macvim, alias mvim, enter your editor here if different:

    `mvim ~/.ssh/config`

    Create your git aliases like so:

    ```vim
    #Github (default)
    Host gh
    @@ -45,14 +52,14 @@ I am using macvim, alias mvim, enter your editor here if different:
    IdentityFile ~/.ssh/id_rsa_bb
    ```

    ## Add the identity to SSH:
    ## Add the identities to SSH:

    ```shell
    ssh-add ~/.ssh/id_rsa
    ssh-add ~/.ssh/id_rsa_bb
    ```

    Enter passphrase when prompted.
    Enter passphrase if prompted.

    Check keys were added:

    @@ -68,7 +75,8 @@ ssh -T bb
    ## Test repositories

    ### Github (default)
    Create a repo online called testmulti
    Create a repo online called testmulti (or one of your choosing), then in Terminal,
    create your repository:

    ```shell
    mkdir ~/testmulti
    @@ -90,10 +98,12 @@ git merge origin/master
    git push origin master
    ```

    If your puzzled why I didn't just do a `git pull` above, it's because I like to compare before I merge.
    If your puzzled why I didn't just do a `git pull` above, it's because I like to
    compare before I merge. I have had quite a few disasters doing a straight pull
    and thinking it will merge perfectly, don't do it.

    ### Bitbucket (secondary)
    Create a repo online called testbucket
    Create a repo online called testbucket and then in Terminal:

    ```shell
    mkdir ~/testbucket
    @@ -110,7 +120,9 @@ git config user.name "Full Name"
    git config user.email email_address
    ```

    This must be done **once** for every *bitbucket* (or secondary) repo, it is not needed for github (or primary) repos because the global is used in that scenario. There may be a cleaner way to do this but right now it works okay.
    This must be done **once** for every *bitbucket* (or secondary) repo, it is not
    needed for github (or primary) repos because the global is used in that scenario.
    There may be a cleaner way to do this but right now it works okay.

    ```shell
    git add .
    @@ -129,7 +141,9 @@ git push origin master
    ```

    ## Use case: Repo already exists on secondary remote repo (bitbucket)
    So you have a repository that already exists and you want to want to `clone` it but also you want to make sure when you `push` it, the correct user, the bitbucket user pushes. Let's say the repo is called `booker`.
    So you have a repository that already exists and you want to want to `clone` it
    but also you want to make sure when you `push` it, the correct user, the bitbucket
    user pushes. Let's say the repo is called `booker`.

    ```shell
    git clone git@bb:bb_username/booker.git
  6. @rosswd rosswd revised this gist Dec 17, 2013. 2 changed files with 10 additions and 3 deletions.
    3 changes: 2 additions & 1 deletion multi-git.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,8 @@ Github will be the main account and bitbucket the secondary.
    ssh-keygen -t rsa -C "github email"
    ssh-keygen -t rsa -C "bitbucket email"
    ```
    Enter passphrase when prompted.
    Enter passphrase when prompted. If you see an option to save the passphrase in
    your keychain, **do it** for an easier life.

    Save keys to:

    10 changes: 8 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,12 @@
    # Setting up a seperate Github and Bitbucket account

    If you want to have private repositories at Bitbucket and public repositories at
    Github, then this is the guide for you. Your life is obviously simpler if you can
    afford Github but I cannot afford it and so this guide was created.

    This guide assumes:

    + git is set up for a single github user using https, not ssh
    + Git is set up for a single github user using https, not ssh
    + There is only a *known_hosts* file in `~/.ssh/`
    + The computer is running Mac OSX 10.7 or greater
    + The computer is running Mac OSX 10.7 or greater
    + You already have an account at [Github](http://www.github.com) and another at [Bitbucket](http://bitbucket.org)
  7. @rosswd rosswd revised this gist Dec 16, 2013. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -127,3 +127,17 @@ git merge origin/master
    git push origin master
    ```

    ## Use case: Repo already exists on secondary remote repo (bitbucket)
    So you have a repository that already exists and you want to want to `clone` it but also you want to make sure when you `push` it, the correct user, the bitbucket user pushes. Let's say the repo is called `booker`.

    ```shell
    git clone git@bb:bb_username/booker.git
    git config user.name "bitbucket user name"
    git config user.email email_address
    ```

    Remember, because we are using the secondary account, we have to over-ride the global configuration of username and email. The git clone command is using the ssh keyfile you set up earlier and is doing the transfer over ssh.

    Now, change into the cloned directory and modify one of the files. Use `git status` to check the current state, then use `git add 'filename'` and `git commit -m "commit message"`.

    Finally push your changes using `git push origin master`.
  8. @rosswd rosswd revised this gist Dec 16, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion multi-git.md
    Original file line number Diff line number Diff line change
    @@ -106,7 +106,7 @@ overwritten, using secondary account values, at the repo level:*

    ```shell
    git config user.name "Full Name"
    git config user.email "email"
    git config user.email email_address
    ```

    This must be done **once** for every *bitbucket* (or secondary) repo, it is not needed for github (or primary) repos because the global is used in that scenario. There may be a cleaner way to do this but right now it works okay.
  9. @rosswd rosswd revised this gist Dec 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Setting up a seperate Github and a bitbucket account
    # Setting up a seperate Github and Bitbucket account
    This guide assumes:

    + git is set up for a single github user using https, not ssh
  10. @rosswd rosswd revised this gist Dec 15, 2013. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -109,9 +109,7 @@ git config user.name "Full Name"
    git config user.email "email"
    ```

    This must be done **once** for every *bitbucket* repo, it is not needed for github
    repos because the global is used in that scenario. There may be a cleaner way
    to do this but right now it works ok.
    This must be done **once** for every *bitbucket* (or secondary) repo, it is not needed for github (or primary) repos because the global is used in that scenario. There may be a cleaner way to do this but right now it works okay.

    ```shell
    git add .
  11. @rosswd rosswd revised this gist Dec 5, 2013. 2 changed files with 5 additions and 3 deletions.
    2 changes: 2 additions & 0 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -89,6 +89,8 @@ git merge origin/master
    git push origin master
    ```

    If your puzzled why I didn't just do a `git pull` above, it's because I like to compare before I merge.

    ### Bitbucket (secondary)
    Create a repo online called testbucket

    6 changes: 3 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Setting up a seperate Github and a bitbucket account
    This guide assumes:

    + git is set up for a github user using https, not ssh
    + There is only a *known_hosts* files in `~/.ssh/`
    + The computer is running Mac OS 10
    + git is set up for a single github user using https, not ssh
    + There is only a *known_hosts* file in `~/.ssh/`
    + The computer is running Mac OSX 10.7 or greater
  12. @rosswd rosswd revised this gist Dec 1, 2013. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Setting up github and bitbucket on the same computer
    Github will be the main account and bitbucket the secondary.

    1. Create SSH Keys
    ## Create SSH Keys

    ```shell
    ssh-keygen -t rsa -C "github email"
    @@ -14,7 +14,7 @@ Save keys to:
    `~/.ssh/id_rsa`
    `~/.ssh/id_rsa_bb`

    2. Attach Keys
    ## Attach Keys
    Login to remote repo and add ssh key:

    ```shell
    @@ -25,7 +25,7 @@ pbcopy < ~/.ssh/id_rsa_bb.pub
    Paste into text area under ssh settings in your github or bitbucket account.
    Also give the ssh key a title like Ross' Laptop.

    3. Create Config file
    ## Create Config file
    I am using macvim, alias mvim, enter your editor here if different:

    `mvim ~/.ssh/config`
    @@ -44,7 +44,7 @@ I am using macvim, alias mvim, enter your editor here if different:
    IdentityFile ~/.ssh/id_rsa_bb
    ```

    4. Add the identity to SSH:
    ## Add the identity to SSH:

    ```shell
    ssh-add ~/.ssh/id_rsa
    @@ -57,16 +57,16 @@ Check keys were added:

    `ssh-add -l`

    5. Check that repo recognizes keys:
    ## Check that repo recognizes keys:

    ```shell
    ssh -T gh
    ssh -T bb
    ```

    6. Test repositories
    ## Test repositories

    ## Github (default)
    ### Github (default)
    Create a repo online called testmulti

    ```shell
    @@ -89,7 +89,7 @@ git merge origin/master
    git push origin master
    ```

    ## Bitbucket (secondary)
    ### Bitbucket (secondary)
    Create a repo online called testbucket

    ```shell
  13. @rosswd rosswd revised this gist Dec 1, 2013. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Setting up github and bitbucket on the same computer
    Github will be the main account and bitbucket the secondary.

    1. Create SSH Keys
    1. Create SSH Keys

    ```shell
    ssh-keygen -t rsa -C "github email"
    @@ -14,7 +14,7 @@ Save keys to:
    `~/.ssh/id_rsa`
    `~/.ssh/id_rsa_bb`

    2. Attach Keys
    2. Attach Keys
    Login to remote repo and add ssh key:

    ```shell
    @@ -25,7 +25,7 @@ pbcopy < ~/.ssh/id_rsa_bb.pub
    Paste into text area under ssh settings in your github or bitbucket account.
    Also give the ssh key a title like Ross' Laptop.

    3. Create Config file
    3. Create Config file
    I am using macvim, alias mvim, enter your editor here if different:

    `mvim ~/.ssh/config`
    @@ -44,7 +44,7 @@ I am using macvim, alias mvim, enter your editor here if different:
    IdentityFile ~/.ssh/id_rsa_bb
    ```

    4. Add the identity to SSH:
    4. Add the identity to SSH:

    ```shell
    ssh-add ~/.ssh/id_rsa
    @@ -57,14 +57,14 @@ Check keys were added:

    `ssh-add -l`

    5. Check that repo recognizes keys:
    5. Check that repo recognizes keys:

    ```shell
    ssh -T gh
    ssh -T bb
    ```

    6. Test repositories
    6. Test repositories

    ## Github (default)
    Create a repo online called testmulti
  14. @rosswd rosswd revised this gist Dec 1, 2013. 1 changed file with 10 additions and 9 deletions.
    19 changes: 10 additions & 9 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -9,10 +9,10 @@ ssh-keygen -t rsa -C "bitbucket email"
    ```
    Enter passphrase when prompted.

    Save keys to:
    Save keys to:

    `~/.ssh/id_rsa`
    `~/.ssh/id_rsa_bb`
    `~/.ssh/id_rsa`
    `~/.ssh/id_rsa_bb`

    2. Attach Keys
    Login to remote repo and add ssh key:
    @@ -23,7 +23,7 @@ pbcopy < ~/.ssh/id_rsa_bb.pub
    ```

    Paste into text area under ssh settings in your github or bitbucket account.
    Also give the ssh key a title like Ross' Laptop.
    Also give the ssh key a title like Ross' Laptop.

    3. Create Config file
    I am using macvim, alias mvim, enter your editor here if different:
    @@ -42,7 +42,7 @@ I am using macvim, alias mvim, enter your editor here if different:
    HostName bitbucket.org
    User git
    IdentityFile ~/.ssh/id_rsa_bb
    ```
    ```

    4. Add the identity to SSH:

    @@ -55,14 +55,14 @@ Enter passphrase when prompted.

    Check keys were added:

    `ssh-add -l`
    `ssh-add -l`

    5. Check that repo recognizes keys:

    ```shell
    ssh -T gh
    ssh -T bb
    ```
    ```

    6. Test repositories

    @@ -109,15 +109,16 @@ git config user.email "email"

    This must be done **once** for every *bitbucket* repo, it is not needed for github
    repos because the global is used in that scenario. There may be a cleaner way
    to do this but right now it works ok.
    to do this but right now it works ok.

    ```shell
    git add .
    git commit -am "first commit"
    git remote add origin git@bb:rosswd/testbucket.git
    git push origin master
    ```

    Add some text to readme on bitbucket.org, then:
    Add some text to readme on bitbucket.org, then:

    ```shell
    git fetch origin master
  15. @rosswd rosswd created this gist Dec 1, 2013.
    128 changes: 128 additions & 0 deletions multi-git.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,128 @@
    # Setting up github and bitbucket on the same computer
    Github will be the main account and bitbucket the secondary.

    1. Create SSH Keys

    ```shell
    ssh-keygen -t rsa -C "github email"
    ssh-keygen -t rsa -C "bitbucket email"
    ```
    Enter passphrase when prompted.

    Save keys to:

    `~/.ssh/id_rsa`
    `~/.ssh/id_rsa_bb`

    2. Attach Keys
    Login to remote repo and add ssh key:

    ```shell
    pbcopy < ~/.ssh/id_rsa.pub
    pbcopy < ~/.ssh/id_rsa_bb.pub
    ```

    Paste into text area under ssh settings in your github or bitbucket account.
    Also give the ssh key a title like Ross' Laptop.

    3. Create Config file
    I am using macvim, alias mvim, enter your editor here if different:

    `mvim ~/.ssh/config`

    ```vim
    #Github (default)
    Host gh
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa
    #Bitbucket (secondary)
    Host bb
    HostName bitbucket.org
    User git
    IdentityFile ~/.ssh/id_rsa_bb
    ```

    4. Add the identity to SSH:

    ```shell
    ssh-add ~/.ssh/id_rsa
    ssh-add ~/.ssh/id_rsa_bb
    ```

    Enter passphrase when prompted.

    Check keys were added:

    `ssh-add -l`

    5. Check that repo recognizes keys:

    ```shell
    ssh -T gh
    ssh -T bb
    ```

    6. Test repositories

    ## Github (default)
    Create a repo online called testmulti

    ```shell
    mkdir ~/testmulti
    cd ~/testmulti
    touch readme.md
    git init
    git add .
    git commit -am "first commit"
    git remote add origin git@gh:rosswd/testmulti.git
    git push origin master
    ```

    Add some text to readme on github.com, then:

    ```shell
    git fetch origin master
    git diff master origin/master
    git merge origin/master
    git push origin master
    ```

    ## Bitbucket (secondary)
    Create a repo online called testbucket

    ```shell
    mkdir ~/testbucket
    cd ~/testbucket
    touch readme.md
    git init
    ```

    *This being the secondary account, the username and email have to be
    overwritten, using secondary account values, at the repo level:*

    ```shell
    git config user.name "Full Name"
    git config user.email "email"
    ```

    This must be done **once** for every *bitbucket* repo, it is not needed for github
    repos because the global is used in that scenario. There may be a cleaner way
    to do this but right now it works ok.

    ```shell
    git add .
    git commit -am "first commit"
    git remote add origin git@bb:rosswd/testbucket.git
    git push origin master

    Add some text to readme on bitbucket.org, then:

    ```shell
    git fetch origin master
    git diff master origin/master
    git merge origin/master
    git push origin master
    ```

    6 changes: 6 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # Setting up a seperate Github and a bitbucket account
    This guide assumes:

    + git is set up for a github user using https, not ssh
    + There is only a *known_hosts* files in `~/.ssh/`
    + The computer is running Mac OS 10