How do I make powershell stop showing this message whenever I push - github

How do I make powershell stop showing the below message:
github --credentials get: github: command not found
This occurs whenever I try to ssh for git push or git pull.

Check you git remote -v: it you see https, it is not an ssh url.
Make sure push or pull are using an ssh url with:
git remote set-url origin git#github.com:username/repo.git
If you are using https, Git will try and use a credential helper: see if git config -l | grep cred returns anything. That would explain the github: command not found part.
If you have, go to your repo and type:
cd /path/to/my/repo
git config credential.helper ""
If your git is recent enough (Git 2.9+), that will prevent any credential helper to be active in your repo.

Related

Upload file by git lfs correctly

I tried to upload large file ( 240mb ) to github by lfs by using
- git lfs install
- git init
- git remote add origin "my repo url"
- git lfs track "*.weights"
- git add yolov3.weights
- git commit -m "test"
- git push -u origin master
after uploaded i found the file content
versionversion https://git-lfs.github.com/spec/v1
oid sha256:c49c28814dc8bcd2c48aac1c3e41c92a183cf9b282f6ca4c05f3d99393137952
size 246305388
And not working but the size still 240 mb
How to upload the file right or what is the wrong?
Did you try pushing the code using this command ?
git push origin <branch name> --force
HTTPS protocol can sometimes be unreliable when it comes to pushing large files . It may break unexpectedly
why dont you try pushing the code via SSH method ?
Run these commands below ::
ssh-keygen -t rsa -b 4096 -C "<email id>"
notepad ~/.ssh/<required key>.pub
// paste this public key into your github account
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/<required_key>.pub
You can learn more about the ssh protocol in this article

Auto push to github without username and password

after much messing around I have followed this tutorial on using a cmd prompt to push up to git hub
http://readwrite.com/2013/10/02/github-for-beginners-part-2
However I have had to do a few things differently. Generating and adding the public key in GitHub went fine, however, adding the private key on my local machine has been a real pain.
I finally added it by opening a cmd prompt as administrator. then going to the directory where github was installed I then rand the following cmds to install the private key
bash
eval $(ssh-agent)
cd to-directory-where-private-.ssh-file-was-located
ssh-add .ssh
Identity added: .ssh (.ssh)
Prior to that I had numerous errors. However, when I run this from a batch file
cd c:/LocalDevelopment/PhoneGap/PfpMetrol
git init
git status
git add PhonegapData.js
git commit -m "Add PhonegapData.js"
git remote -v
git push
pause
it is still asking me for a username and password.

How to set up git to use ssh instead of https?

$ git remote -v
origin https://github.com/my-repo/site-web.git (fetch)
origin https://github.com/my-repo/site-web.git (push)
I have ssh set up and a shell script to run like this:
ssh -T git#github.com
git reset --hard
...
git pull
But I still get prompted for a password. I assume the remote needs to be git#github.com for the ssh to work.
I have four directories... a/ b/ c/ and d/ and all of them point to this remote. But I really only want ssh to work in a/. I'm happy to keep using https for the others.
What do I do?
If a/ is a git repo, you can simply change its remote:
cd a
git remote set-url origin git#github.com/my-repo/site-web.git
But if a, b, c and d are folder of the same repo, that would change origin for all of them.
To have ssh only for a/, you would need a separate clone, as a sparse checkout, in order to work only with a/ content (and have the right remote url for that separate clone).
You need to add your .ssh/id_rsa.pub to you github account.

How to Commit in github?

i am getting error sh.exe: notepad: command not found please short out my problem
Thanks
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.
Seps:
1.git init
2. git status
3. git add .
4. git commit -a
5. git status

github file not getting committed

I am new to GitHub, but I have followed the steps to create a repo:
$ mkdir fb
$ cd fb
$ git init
$ git add README
$ git commit -m 'first commit'
$ git push origin master
Now when I try to make my first commit, I get the follwowing error:
$ git push origin master
error: Cannot access URL https://github.com/xxx/yyy/, return code 60
error: failed to push some refs to 'https://github.com/xxx/yyy'
I am using the latest git version. Why does GitHub throw this unusal error and how do I fix it?
What if you try using the SSH protocol for the git repository, e.g. git#github.com:xxx/yyy.git, and see if that works for you?
$ git remote rm origin
$ git remote add origin git#github.com:xxx/yyy.git
I believe that return error code has something to do with the SSL Certificate... I'm sorry I cannot help further.