How to work with two different BitBucket accounts in SourceTree

前端 未结 9 430
天命终不由人
天命终不由人 2021-02-01 13:00

I have two different bitbucket accounts set up. One is for work projects and one is for personal use. In BitBucket I have set up a repository in each of the accounts for diffe

9条回答
  •  生来不讨喜
    2021-02-01 13:24

    If you've already cloned a repository with ssh on the Mac version, and you want to change the account for it, you can do this by changing the host name of the remote.

    If you've let SourceTree modify your ˜/.ssh/config , then it will have added some entries starting with:

    # --- Sourcetree Generated ---
    Host -
        ...
    

    Choose the - combination that you want to use and modify the path of your repository (in Remote Settings). Your new path will be something like the following format:

    git@-:/.git
    

    (Actually, you can use this solution for working copies not cloned by SourceTree too.)

提交回复
热议问题