How do I clone a gist using https:// instead of git:// - gist

At my office we are not able to connect to github using git:// urls. For the regular repositories we just juse the https:// url and we're fine.
For gist there does not appear to be a way to access the gist via an https:// url.
BTW, I cannot seem to find any github documentation about gist ... I recall reading a page on github(?) about gist, but for the life of me I cannot find anything on the site itself that documents gist ... of course google is useless as gist show up everywhere ... but no documentation links:(
Thanks in advance.

You can configure git to use https:// globally by running running git config --global url."https://".insteadOf git:// or by adding the following to ~/.gitconfig:
[url "https://"]
insteadOf = git://

I only fing a way to get the raw file(s) through http :
GET http://gist.github.com/raw/:gist_id/:filename
found on the gist API page of github:
http://develop.github.com/p/gist.html (archived copy)

I'm able to use the gist's URL without any trouble. This:
git clone https://gist.github.com/{user}/{gist id}
works fine for me, where https://gist.github.com/{user}/{gist id} is the actual URL of the gist. I'm about to clone and and to push. It doesn't use my SSH keys to push -- I have to give my username and password -- but otherwise it works fine.

Related

Can't connect to my github repository from netbeans

I'm trying to connect to my github repository with netbeans but I get this error
Cannot connect to repository at https://github.com/dfuvx98/ingSWoct2019.git
I copy the link from github and also put right my username and password.
I'm trying to clone the repository with htttp
Generate personal access tokens and put the token instead of the password in the password box.
https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/about-authentication-to-github
For testing, try and clone it from the command-line:
git clone https://github.com/dfuvx98/ingSWoct2019
Then import the (currently empty) repo into Netbeans.
It would be easier if that repository included a project of some kind.
If you do the clone through NetBeans, make sure to use the HTTPS URL (not http:// as it is shown by default)
If you can reach the repo from your web browser, it could be a proxy issue. Are you behind any firewall? or Are you using any proxy?
If you are behind a proxy, then you may need to provide proxy settings to Netbeans.
see - https://ui.netbeans.org/docs/ui/proxyConfiguration/
Hope it helps!

I cannot upload my iOS project to github

Whenever I try to upload the project to github the following error is coming.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Please somebody help me. I am new to to github. I cannot understand what is wrong
You are likely trying to connect to GitHub using SSH. Try this link if you want to use ssh. Instead the more preferred method is to push/pull over HTTPS. Try this instead git remote set-url origin https://github.com/User/UserRepo.git. Then if you push, git will ask for your email and password and most probably be successful. Using Https also solves the problem of push/pull behind firewalls
sounds like you haven't properly set up your SSH key for github. The GitHub Documentation should be a good place to start help you properly set up your SSH keys.

Redirecting http requests to git resources to github.com

I'm wondering if it would be possible to use vanity URLs for git repositories without to mirror the repository itself. Basically to just and issue redirects. Example: I would like to make my github repository available on mydomain.com/repoName. When someone tries to clone push etc to this remote I would issue a redirect to github.com/myusername/myrepo. Is a such thing possible ?
This is definitely not a git issue. It's about redirecting http requests to corresponding URLs on github. I don't know if there's anything that does it "out of the box" but given the nice resources names on github, I think a few lines in your http server config file should do it.

First time using github and want to know command to access a repository

I just installed github in ubuntu and i don't know the commands to login with my username and password and command to access a repository and work on it
Thanks
Best way for linux is probably to give github your public key in your settings page, rather than log in as such. Then you can add a github repository to your local repository with git remote add git#github.com:<repopath> and push/pull from it with git push and git pull respectively using SSH for authentication instead of username and password.
If you don't understand any of what I've just said, I'd recommend looking at some tutorials, like this GitHub help article or Try Git.

How do you completely remove a file on github

I've seen the command needed to remove a file and erase it from the history on git. Is there a way to do this with the github website? If not, it looks like I need to know where the file is to do it with a git command. Where does github store the local repositories?
See: https://help.github.com/articles/remove-sensitive-data
To get a local version of the repository, look up the URL from the repo page on Github and clone as explained in the link above.