When trying to commit using Sourcetree, getting following error

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\Users\Admin\AppData\Local\Temp\ldlruhbf.ejs

*** 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.

 

But when tried to Run the commands from command line it does not recognize "git".

6 answers

1 accepted

Hello Pavan!

First of all: as already asked by Seth, are you using Windows' Command Prompt (cmd.exe) or SourceTree's Terminal? It's recommended that you use SourceTree's own Terminal, but you can also do some adjustments in order to have your Windows' Command Prompt setup for git commands.

  1. First and foremost, download Git from its website;
  2. When installing the software, you will be prompted for the manner you prefer to use Git, like below:image2015-1-6 11:58:56.png
  3. Only having Git setup for the command prompt will make the commands you ran before work just fine, but you can also choose the latter option, just be aware of the possible consequences;

information If you already have installed Git by following the above procedure, please follow the instructions below to add Git's executable as an Environment Variable.

  1. Look for the Git's installation path (normally under C:\Program Files\Git, but can also be under C:\Program Files (x86)\Git if you use a x64-based Windows version);
  2. Inside the installation folder, go to \bin directory and copy the path to it;
  3. Then, go to "Control Panel > System" and, on the sidebar of this window, click in "Advanced system settings";
  4. Go to the "Advanced" tab and click in "Environment Variables..." on the bottom of the window;
  5. Under "System variables", click twice on "Path";
  6. Move the cursor to the very end of the "Variable value:" field, add a semi-colon and paste the path to the \bin folder that you got on the first step;

tick That's it! You should now be able to run git commands from Windows' Command Prompt!

 

Regards!

-Joao

Windows or Mac? Did you open the command line from the OS, or use SourceTree's "Terminal" button?

Thanks Seth! On Windows. I Staged the file which needed to be Checked In/Commit. Then clicked on Commit button.

Please let me know if there is a quick step guide on how to use SourceTree.

For my second question, I meant when you tried to run from the command line. Did you run a typical command prompt (for example, Run -> cmd)? If so, that probably won't work. Try hitting the "Terminal" button in SourceTree and then running the git config command.

Thanks Seth! Got it working!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

647 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you