Difficulty cloning individuality file from github repository - github

I'm trying to pull an individual file from a private github repository of mine, and am having difficulties.
Specifically, this works:
git clone git#github.com:userName/repositoryName.git
but I can't seem to find any documentation in how to clone/get a single file. I've tried a few variations:
git clone git#github.com/userName/repositoryName/blob/master/example.py
git clone git#github.com/userName/repositroyName.git/example.py
Each time I get prompted for my password:
Cloning into 'example.py'...
Enter passphrase for key '/home/root/.ssh/id_rsa':
Except upon entering my valid password, I get:
ERROR: Repositroy not found.
fatal: The remote end hung up unexpectedly
Not sure what to do at this point, I'm running Angstrom Linux 3.2.28

Related

Authentication failed and unable to link visual studio to git repository

I am trying to set up to build my first website and have been following an online tutorial. When trying to link visual studio and my GitHub repository, this is the message I get:
`
samanthacanela#samanthas-air Canela Street Art % git commit -m "initialized git repository"
[main 3a08e0a] initialized git repository
2 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 about.html
rename homepage.html => home.html (100%)
samanthacanela#samanthas-air Canela Street Art % git push
fatal: The current branch main has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin main
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
samanthacanela#samanthas-air Canela Street Art % git push --set-upstream origin main
The authenticity of host 'github.com (140.82.112.3)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
samanthacanela#samanthas-air Canela Street Art %
`
I'm an absolute beginner. What the hell am I doing wrong?
I was following along a tutorial and they lost me.
Based on my understanding, I can see that you may haven't setup the origin remote URI. To fix that issue, you'll need to follow these steps.
Logging into git (If you aren't already)
Run these commands to set your display name and email when pushing:-
$ git config --global user.name "Your name here"
$ git config --global user.email "your_email#example.com"
Using HTTPS access method (recommended)
Using GitHub CLI, you can run $ git auth login and follow the steps to login.
Or if you're using GCM (Git Credential Manager)* refer to this article by GitHub
* GCM is another way to store your credentials securely and connect to GitHub over HTTPS. With GCM, you don't have to manually create and store a personal access token, as GCM manages authentication on your behalf, including 2FA (two-factor authentication).
Using SSH access method
If you clone with SSH, you must generate SSH keys on each computer you use to push or pull from GitHub. For more information, see "Generating a new SSH key."
Setting up your repository
** Make sure to run these commands inside your git environment and not globally.
#Set a new remote
git remote add origin github.com/example/example.git
#Verify new remote
git remote -v
Basically, a common cause for an error after following these steps is cloning using HTTPS method instead of SSH. You can correct this by going to your repository, clicking "Clone or download", then clicking the "Use SSH" button above the URL field and updating the URL of your origin remote like this:
$ git remote set-url origin git#github.com:ex-user/example.git
And that forces the source to be SSH.
If this still gives you an error, please refer to this answer.
For more help, refer to this document.

git clone is throwing repository not found error

While trying to clone my private repository, I'm getting the following error
fatal: repository 'https://github.com/kefitech/qp-guard.git/' not found
I have done some googling but unable to solve the issue.
Steps completed
1. config --global user.name and password is set using terminal (windows cmd)
2. git remote -v
git remote -v is returning an error:
fatal: not a git repository (or any of the parent directories): .git
So, tried set the remote URL to my repository using the command:
git remote set-url origin https://<my-user>#github.com/<my-org>/qp-guard.git
Bur this also returning the same error returned by git remote -v command
Please note that:
1. I'm a collaborator
2. I can clone any public repos
3. I have not used git client (terminal, cmd) for a long time but it was working before.
Looking forward to any pointers to solve this issue.

Git Unable to Commit

I am getting the following issue when attempting to commit on github desktop to github:
error: cannot spawn null: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
Originally I was getting just a fatal error based on the cannot spawn null, but then I ran
git config --global commit.gpgsign tru
to get the current error.
I tried deleting and then re-cloning the repo and even individually deleting every file in the repo that I can without making github desktop no longer register the directory as a repo, to no avail. I have no idea how to resolve this at this point or what would even be causing the issue. Ideas?
Note: the issue is located to this single repo, all my other repos are working fine.
Edit:
Results of:
git config --local -l
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
submodule.active=.
remote.origin.url=https://github.com/***{this information is correct}***.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
commit.gpgsign=true

How to fix issue when using github add, commit and then push?

I initialized a repo in my GitHub. I issued a git clone command. I went to the directory in my local computer where I wanted to clone the repo. Then I copied some files in my local drive. Then I did:
git add .
git commit
git push -u origin master
The message appeared:
remote: Permission to jasonkid1/testuli.git denied to jpamittan.
fatal: unable to access
'https://jasonkid1#github.com/jasonkid1/testuli.git/': The requested
URL returned error: 403
How can I fix this?
For any https authentication issue, you need to check your credential caching:
git config credential.helper
That is:
On Windows, for instance, you would need to open the Windows Credential Manager and check the right password was entered.
On Mac, you would need to update the OSX keychain.
You might have credentials for any github.com URL associated to jpamittan (wrong user) instead of jasonkid1.

Github Push fatal: repository not found (hyphenated username)

Trying to get started with GitHub for the first time. I was following the instructions on the GitHub website to just set up a simple repository and push the Readme file to it.
I wanted to use the terminal first before using a GUI like Github for Windows. So I'm using MINGW32 as the site suggested. However whenever I go to push my file I get
fatal: repository 'https://github.com/fidflash/Hello-World.git/' not found
I'm sure it's because my username is kid-flash not kidflash. It seems that the terminal is trimming the hyphen out of my username in the URL. I use the hyphen when I type in my username. It even prompts "Password for 'https://kid-flash#github.com': "
any ideas how to keep the terminal (or maybe it's Git doing it) from trimming my username?
thanks
Got a response from GitHub support tonight:
I think the dash is actually missing from the origin remote's URL. Can
you try setting the origin remote with the following command and
pushing again?
$ git remote set-url origin
https://github.com/kid-flash/Hello-World.git
I tried it and it worked perfectly.