When trying to commit using Sourcetree, getting following error

PavanN January 5, 2015

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

1 vote
Answer accepted
João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2015

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

0 votes
PavanN January 7, 2015

Thanks Seth! Got it working!

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2015

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.

0 votes
PavanN January 6, 2015

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

0 votes
PavanN January 6, 2015

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

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events