0

I created a public repository on Github and cloned it. While on Fedora, I was able to commit and push to the repository. SmartGit allowed me to connect to the repository via an authentication token. But when I came to Windows and tried to clone the repository, SmartGit is able to stage and commit, but trying to push, causes an "Authentication failure". I googled it and the below links didn't help (probably because I didn't do it right). I've been stuck with this problem for quite a while now.

How can I resolve a permission denied error with git-remote-https?
SmartGit won't authenticate with ssh
http://derekreynolds.wordpress.com/2011/01/18/how-to-set-up-smartgit-with-github/

  1. Is it because a read-only repository got created on my local system?
  2. Howcome in Windows, SmartGit doesn't allow an option to authenticate with an authentication token?
  3. Could anyone explain the step by step procedure of cloning a public repository until being able to push changes/new-files to it?
Community
  • 1
  • 1
Nav
  • 19,885
  • 27
  • 92
  • 135
  • Did you add your new RSA public key to your github account? – totoro Mar 31 '14 at 12:28
  • Yes I added it to the Github account (had generated it using Git GUI), but how do I get SmartGit to recognize it? – Nav Mar 31 '14 at 13:08

1 Answers1

0

Most novices won't understand the process of adding an RSA key. Moreover, there are problems that happen if PuTTY is installed. The GIT_SSH environment variable will point to either "plink" or "plink.exe" at program files, and the cloning via Git Bash won't work.

The solution is to create an RSA key via the Git GUI, add the RSA key to your Github account in account settings and unset GIT_SSH at the Git bash command prompt. Now you'll be able to clone using ssh and push too. More details on my blog: http://nrecursions.blogspot.in/2014/04/pushing-to-github-without.html

Just open up the Git Bash prompt in Windows, and type unset GIT_SSH.

To clone: First, copy the SSH link from GitHub.
Now use that link in Git Bash like so (attribution):

git clone git@github.com:yourusername/yourrepositoryname.git

The remote repository will now be cloned onto your local PC. Create a few new files in the local repository and add them to the local repository by typing:

git add .

This will add the new files to your local Git repository (note the space and the dot after 'add'). Commit by:

git commit -m "some message"

and push to the remote server using:

git push

It's as simple as that!

Nav
  • 19,885
  • 27
  • 92
  • 135