Search code examples
githubbitbucketatlassian-sourcetreesourcetree

SourceTree how to load my account username & email (from bitbucket, github)?


Hello I am on multiple git websites like bitbucket, github & co. I have different usernames & emails but Sourcetree forces me to type my name and email. So it doesn't load itself.

It is not possible to use my account information from their website without to login ( on the website) and look for my email and typ in sourcetree? Its little bit annoying to this on new projects.

EDIT: What I mean is in other words: I want to have load my account information automated from bitbucket, github so I do not need type everytime on new repo and check everytime on their website what username or email was set up.

Just as question if it is possible.


Solution

  • Just as question if it is possible

    Not really.
    What I do is:

    On Windows, I define those aliases as:

    doskey gcu=git config user.name "Name1" ^&^& git config user.email email1@com
    doskey gcu2=git config user.name "Name2" ^&^& git config user.email email2@com
    

    Then, in a repo, I typo (only once) gcu or gcu2, depending on the nature of that repo.

    If I forget to type it, I won't be able to create a commit without the error message:

    *** Please tell me who you are.
    
    Run
    
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"
    
    to set your account's default identity.
    Omit --global to set the identity only in this repository.
    
    fatal: no name was given and auto-detection is disabled