3

i am getting error when i am trying to commit

i am getting error sh.exe: notepad: command not found please short out my problem Thanks

Shakti
  • 89
  • 2
  • 3
  • 10

2 Answers2

1

For the commit to GitHub part, you need to add (if you have created an empty yourRepo on GitHub):

git config user.name yourGitHubUsername
git config user.email yourGitHubEmail
git add .
git commit -m "First commit"
git remote add origin https://yourAccount@github.com/yourAccount/yourRepo
git push -u origin master

If that fails because GitHub already created one commit when you initialized your "empty" repo (it can add by default a README.md and a .gitignore), do a:

git pull --rebase origin master
git push -u origin master

If you really have to call notepad from a mingw session, you can use this wrapper:

#!/bin/sh
'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar \
  -nosession -noPlugin "$(cygpath -w "$*")"

But remember you can use msysgit from a DOS session as well.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • w2hen i writ this line and enter i am getting errot sh.exe":remote:command not found – Shakti Jan 15 '14 at 07:38
  • @Shakti did you type "git remote" or just "remote"? How did you launch your mingw session? Through Git? What version of Git did you install? – VonC Jan 15 '14 at 07:40
  • @Shakti that is not how git commands work: you type git xxxx, not xxxx. – VonC Jan 15 '14 at 07:49
  • in next section i typed $git push -u origin master i am getting following error – Shakti Jan 15 '14 at 07:56
  • fatal:could not read username for 'https://github.com': No such file or directory – Shakti Jan 15 '14 at 07:57
  • What does `git remote -v` returns? And please tell me you did replace `yourGitHubUsername` (or `yourAccount`) and `yourGitHubEmail`, and `yourRepo` by actual values – VonC Jan 15 '14 at 07:58
  • i did not replace any thing – Shakti Jan 15 '14 at 08:00
  • @Shakti Why did you not replace something like `yourGitHubUsername` by... I don't know, *your actual GitHub username*? It was given as a generic example, for you to tailor and adapt to your specific account. – VonC Jan 15 '14 at 08:01
  • my user.name is dany001 – Shakti Jan 15 '14 at 08:06
  • @Shakti ok, I see https://github.com/Dany001/project/commits. So `yourGitHubUsername` or `yourAccount` equals `Dany001` (the case is important). – VonC Jan 15 '14 at 08:08
  • dear sir i did'nt get your mean – Shakti Jan 15 '14 at 08:14
  • @Shakti "the case is important" means you must replace `yourGitHubUsername` or `yourAccount` by `Dany001`, not `danny001`: You need to respect the upercase and lowercase letters. – VonC Jan 15 '14 at 08:17
  • why should i change my username – Shakti Jan 15 '14 at 09:17
  • @Shakti I am asking you to change the `yourGitHubUsername` (I used in my example) by your actual username on GitHub, which is `Dany001`. I am *not* asking you to change your username on GitHub. Keep `Dany001`. – VonC Jan 15 '14 at 09:19
  • are yuo asking user.email or user.name – Shakti Jan 15 '14 at 09:28
  • You must set, within your local repo, your name and email used for your commit. In order for GitHub to see that it is "you" who did those commits you are about to push, it is important you set `user.name` and `user.email` to your GitHub account name (`Danny001`) and GitHub email. – VonC Jan 15 '14 at 09:30
  • YES SIR I CHANGED USERNAME FROM TOUR EXAMPLE – Shakti Jan 15 '14 at 09:30
  • i am using this git config user.name Dany001 git config user.email sharmarahul696@gmail.com git add EEADME.md git commit -m "HIIII" git remote add origin https://yourAccount@github.com/Dany001/javaprojectdany.git git push -u origin master – Shakti Jan 15 '14 at 09:32
0

Seps: 1.git init 2. git status 3. git add . 4. git commit -a 5. git status

sandipon
  • 986
  • 1
  • 6
  • 19