- How To Download Files From GitHub
- Downloading a File From GitHub
- Downloading GitHub Files Using Commands
- There’s a Better Way to Download Files
- Closing
- jwebcat / gist:5122366
- This comment has been minimized.
- ddimitrioglo commented Nov 12, 2017
- This comment has been minimized.
- devpie commented Mar 2, 2018
- This comment has been minimized.
- dnanto commented May 26, 2019
- This comment has been minimized.
- ny0x696 commented May 27, 2019
- This comment has been minimized.
- lucasbasquerotto commented Aug 23, 2019
- This comment has been minimized.
- pushpdeep commented Oct 25, 2019
- This comment has been minimized.
- guillerglez88 commented Nov 14, 2019
- This comment has been minimized.
- littlejeem commented Dec 7, 2019
- This comment has been minimized.
- MagicJohnJang commented Feb 17, 2020 •
- This comment has been minimized.
- Darrenzzy commented May 27, 2020
- This comment has been minimized.
- tarpanpathak commented Jul 24, 2020
- This comment has been minimized.
- OctavioBR commented Aug 4, 2020
- This comment has been minimized.
- OctavioBR commented Aug 4, 2020
- This comment has been minimized.
- g0d0 commented Aug 5, 2020 •
- This comment has been minimized.
- trylaarsdam commented Aug 22, 2020
- This comment has been minimized.
- dienluong commented Aug 27, 2020
- derhuerst / intro.md
- This comment has been minimized.
- alhadhrami commented Nov 9, 2017
- This comment has been minimized.
- rgnest commented Jan 6, 2018 •
- This comment has been minimized.
- mithlesh4257 commented Jan 7, 2018
- This comment has been minimized.
- elseagle commented Jan 18, 2018
- This comment has been minimized.
- Kaarthick912 commented Mar 5, 2018
- This comment has been minimized.
- Aztechtcs commented Mar 11, 2018
- This comment has been minimized.
- Joshua56 commented Mar 30, 2018
- This comment has been minimized.
- Joshua56 commented Mar 30, 2018
- This comment has been minimized.
- reddyvenu commented Apr 10, 2018
- This comment has been minimized.
- imad-bouramana commented Apr 29, 2018
- This comment has been minimized.
- webbertakken commented Aug 15, 2018 •
- This comment has been minimized.
- oscrx commented Sep 13, 2018 •
- This comment has been minimized.
- Princewillsarlex commented Nov 15, 2018
- This comment has been minimized.
- adkumar321 commented Jan 18, 2019
- This comment has been minimized.
- DuncantheeDuncan commented Mar 9, 2019 •
- This comment has been minimized.
- NetJayNoob commented Mar 19, 2019
- This comment has been minimized.
- Anthomy1 commented May 30, 2019
- This comment has been minimized.
- Anthomy1 commented May 30, 2019
- This comment has been minimized.
- virgilwashere commented Jun 4, 2019
- Install git on Ubuntu
- This comment has been minimized.
- virgilwashere commented Jun 4, 2019
- This comment has been minimized.
- sagynov commented Jun 16, 2019
- This comment has been minimized.
- Knlsharma commented Jul 22, 2019
- This comment has been minimized.
- Lucifer8759 commented Jul 23, 2019
- This comment has been minimized.
- mark-nirdesh commented Dec 17, 2019
- This comment has been minimized.
- ocBruno commented Feb 14, 2020
- This comment has been minimized.
- CyberChick111 commented Mar 6, 2020
- This comment has been minimized.
- Phontera commented Mar 31, 2020
- This comment has been minimized.
- gprakarsh commented Aug 10, 2020
- This comment has been minimized.
- ASCassinda commented Aug 25, 2020
- This comment has been minimized.
- Cyber-Guy24 commented Sep 3, 2020
- This comment has been minimized.
- wajeehas commented Sep 13, 2020
- This comment has been minimized.
- derhuerst commented Sep 14, 2020
- This comment has been minimized.
- mahfudivan commented Sep 23, 2020
- This comment has been minimized.
- temoke-levelops commented Nov 5, 2020
- This comment has been minimized.
- mavaddat commented Dec 19, 2020
- This comment has been minimized.
- AssefaDemeke12 commented Dec 26, 2020
- This comment has been minimized.
- Poojap19create commented Mar 26, 2021
- This comment has been minimized.
- mavaddat commented Mar 29, 2021 •
How To Download Files From GitHub
If you’ve ever used GitHub before, you know that it’s not immediately clear on how to download files from the platform. It’s one of the more complicated platform, as it isn’t directly meant for direct file sharing, but for development instead. Granted, one of the big things about GitHub is that all of the public repositories are open source, and people are encouraged to contribute — there are private repositories, but these are generally used for development purposes within businesses that don’t want their code seen by the public. GitHub, however, still handles downloading files differently than other places.
So if you’re not entirely sure how you can download files from projects (or entire projects) from GitHub, we’re going to show you how. Let’s get started.
Downloading a File From GitHub
Most public repositories can be downloaded for free, without even a user account. This is because public repositories are considered to be codebases that are open source. That said, unless the owner of the codebase checks a box otherwise, their codebase can be downloaded onto your computer, packed into a .zip file.
- So, if you go to a public codebase — such as this Tip Calculator that I built — you’ll notice that in the top-right corner is a green button that says Clone or Download, click on the button.
- Then, in the dropdown, select Download ZIP. All of the files will begin downloading to your computer, usually in your Downloads folder.
- Then, open your Downloads folder on your computer and find the ZIP file. You’ll want to right-click it and choose the option that says Extract All…, Unzip, or Uncompress, and then select a folder where you want the files to end up.
- Finally, navigate to that selected folder, and you’ll find all of those Github files that we downloaded right there!
That’s a fairly small codebase, with only a couple of files in it. If you go to Wes Bos’ JavaScript 30 repository on Github, you’ll notice that — since it is a public repository — it can be downloaded the same way.
Downloading GitHub Files Using Commands
Alternatively, you can easily clone a file or repository using a few simple commands on GitHub. For this to work, you’ll need to install the Git tools. We’re going to be installing the same tip calculator from the command line in this demo.
- Copy the URL from your address bar or from the same menu where you downloaded the zip file from.
- Open up Git Bash, type in “cd Downloads” and hit Enter. This will take you to the Downloads folder in the command window, you can also type whatever file location you want to save the file in.
- Now, type in “git clone https://github.com/bdward16/tip-calculator.git“and hit Enter.
- Using this method, the files are automatically unzipped when downloaded.
There’s a Better Way to Download Files
While the way we outlined is simple and straightforward, it’s most optimal for simply viewing the code files, not experimenting. If you’re planning on downloading GitHub files to experiment with, the best way would be to “fork” the project. A fork is simply your own copy of a repository.
Forking a repository comes with a number of benefits. It gives you your own copy on your GitHub account that allows you to freely experiment with changes without affecting the original project. For example, you could find a bug in my Tip Calculator or want to add your own features. So, you could “fork” my Tip Calculator, creating a copy on your GitHub account. Here, you could mess around the code and experiment with it without affecting the original project, because this would be your copy or “fork.”
Most commonly, forks are used to either propose changes to someone else’s project, like fixing a bug or adding a feature as we mentioned.
So, how do you fork a public repository? It’s actually quite easy. Before we get started, you need to create a free GitHub account, as you’ll need somewhere to store your fork. You can head to www.github.com and do this right now.
Once you have your account created, you can fork a public repository to your account.
- For example, you can head over to the public repository for Wes Bos’ 30 Days of JavaScript training course, and in the top-right corner, you’ll see a button that says Fork. Click the button.
- It could take a couple of seconds to a few minutes, but GitHub will then clone or “fork” that project over to your own GitHub account. Once it’s done, it’ll immediately show you the project under your GitHub username.
- To verify, you can click on your profile icon in the navigation bar at the top-right, and then select the option that says Your Repositories . In your list of repositories, you should see the JavaScript 30 course codebase.
Now, you can change and experiment with the code all you want, and it won’t affect the original project files of the original owner. If you change some code, fix a bug, or add a new feature, you can create something called a “Pull Request,” where that change can be discussed. If the original project owner likes the change — and it works properly — it can be merged into the original codebase as production code.
Closing
As you can see, downloading files and whole projects from GitHub is actually quite easy. In just a couple of minutes, you can have an entire project downloaded onto your computer, or even forked to your own GitHub account. It doesn’t take much to mess around with the code in your fork to see what affects what, and then eventually, you might even be able to create your first pull request! Happy coding!
Источник
jwebcat / gist:5122366
wget —no-check-certificate —content-disposition https://github.com/joyent/node/tarball/v0.7.1 |
# —no-check-cerftificate was necessary for me to have wget not puke about https |
curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
This comment has been minimized.
Copy link Quote reply
ddimitrioglo commented Nov 12, 2017
This comment has been minimized.
Copy link Quote reply
devpie commented Mar 2, 2018
That’s great. Thanks.
This comment has been minimized.
Copy link Quote reply
dnanto commented May 26, 2019
This was driving me crazy, thanks!
This comment has been minimized.
Copy link Quote reply
ny0x696 commented May 27, 2019
Fantastic!! thank you
This comment has been minimized.
Copy link Quote reply
lucasbasquerotto commented Aug 23, 2019
This comment has been minimized.
Copy link Quote reply
pushpdeep commented Oct 25, 2019
This comment has been minimized.
Copy link Quote reply
guillerglez88 commented Nov 14, 2019
This comment has been minimized.
Copy link Quote reply
littlejeem commented Dec 7, 2019
This comment has been minimized.
Copy link Quote reply
MagicJohnJang commented Feb 17, 2020 •
This comment has been minimized.
Copy link Quote reply
Darrenzzy commented May 27, 2020
This comment has been minimized.
Copy link Quote reply
tarpanpathak commented Jul 24, 2020
This comment has been minimized.
Copy link Quote reply
OctavioBR commented Aug 4, 2020
For people who like the long, more understandable form of curl options to be used in scripts:
This comment has been minimized.
Copy link Quote reply
OctavioBR commented Aug 4, 2020
Don’t know why —remote-header-name is required. It works fine only with —location & —remote-name
This comment has been minimized.
Copy link Quote reply
g0d0 commented Aug 5, 2020 •
None of these examples work for me. 404 is returned.
This comment has been minimized.
Copy link Quote reply
trylaarsdam commented Aug 22, 2020
thanks for this!
None of these examples work for me. 404 is returned.
This likely means your URL is invalid (the file isn’t on the server)
This comment has been minimized.
Copy link Quote reply
dienluong commented Aug 27, 2020
(HTTP) This option tells the -O, —remote-name option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL.
If the server specifies a file name and a file with that name already exists in the current working directory it will not be overwritten and an error will occur. If the server doesn’t specify a file name then this option has no effect.
There’s no attempt to decode %-sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names.
WARNING: Exercise judicious use of this option, especially on Windows. A rogue server could send you the name of a DLL or other file that could possibly be loaded automatically by Windows or some third party software.
Generally, one shouldn’t blindly use command options without knowing what they do.
Источник
derhuerst / intro.md
Installing Git – the easy way
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Choose one of the following options.
Determine on which Linux distribution your system is based on. See List of Linux distributions – Wikipedia for a list. Most Linux systems – including Ubuntu – are Debian-based.
Debian-based linux systems
Open a terminal window. Copy & paste the following into the terminal window and hit Return . You may be prompted to enter your password.
You can use Git now.
Red Hat-based linux systems
Open a terminal. Copy & paste the following into the terminal window and hit Return . You may be prompted to enter your password.
You can use Git now.
Homebrew […] simplifies the installation of software on the Mac OS X operating system.
Copy & paste the following into the terminal window and hit Return .
You will be offered to install the Command Line Developer Tools from Apple. Confirm by clicking Install. After the installation finished, continue installing Homebrew by hitting Return again.
Step 2 – Install Git
Copy & paste the following into the terminal window and hit Return .
You can use Git now.
Installing Git on Windows
- DownloadGit from Git for Windows and install it.
This comment has been minimized.
Copy link Quote reply
alhadhrami commented Nov 9, 2017
Wrong link in ‘intro.md’ for «Instructions for Windows». I was going to create a pull request, but then remembered that doesn’t exist in gist.
This comment has been minimized.
Copy link Quote reply
rgnest commented Jan 6, 2018 •
You shoud before do «cd» the directrory should be yours home. Or will have error.
I mean macos.
This comment has been minimized.
Copy link Quote reply
mithlesh4257 commented Jan 7, 2018
Git is not installing in Ubuntu. Please help!
This comment has been minimized.
Copy link Quote reply
elseagle commented Jan 18, 2018
@mithlesh4257 try
sudo apt-get update then sudo apt-get upgrade followed by sudo apt-get install git
This comment has been minimized.
Copy link Quote reply
Kaarthick912 commented Mar 5, 2018
sudo yum upgrade
I ran this command and it removed all existing users. It upgraded like 450 packages and removed some users. Anybody know why this happened ?
This comment has been minimized.
Copy link Quote reply
Aztechtcs commented Mar 11, 2018
same problem here
This comment has been minimized.
Copy link Quote reply
Joshua56 commented Mar 30, 2018
I am having the same problem in my linux mint
This comment has been minimized.
Copy link Quote reply
Joshua56 commented Mar 30, 2018
zenity : Depends: libpango-1.0-0 (>= 1.14.0) but it is not going to be installed
Depends: zenity-common (= 3.18.1.1-1ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a s
This the error of the code
This comment has been minimized.
Copy link Quote reply
reddyvenu commented Apr 10, 2018
same problem here
This comment has been minimized.
Copy link Quote reply
imad-bouramana commented Apr 29, 2018
try this repository
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
This comment has been minimized.
Copy link Quote reply
webbertakken commented Aug 15, 2018 •
I used this as a source for PracticalNotes — Homebrew.md because it is very efficient.
This comment has been minimized.
Copy link Quote reply
oscrx commented Sep 13, 2018 •
Wrong link in ‘intro.md’ for «Instructions for Windows». I was going to create a pull request, but then remembered that doesn’t exist in gist.
Exactly this 😀
But thanks for the guide.
This comment has been minimized.
Copy link Quote reply
Princewillsarlex commented Nov 15, 2018
This comment has been minimized.
Copy link Quote reply
adkumar321 commented Jan 18, 2019
sudo apt-get install aptitude
sudo aptitude install git
This comment has been minimized.
Copy link Quote reply
DuncantheeDuncan commented Mar 9, 2019 •
Thanks it now installed
But Git-it command doesn’t work and git-it verify
So what the next step please help
I’m using Kali Linux
This comment has been minimized.
Copy link Quote reply
NetJayNoob commented Mar 19, 2019
I am having issues with setting the port. When I type ‘set port 80’ I get back as an error: «you can’t set option ‘port’. Available options: [‘target’, ‘http_port'» etc. will this affect my check runs later?
This is on Kali Linux, and is after ‘set target 192.168. )
This comment has been minimized.
Copy link Quote reply
Anthomy1 commented May 30, 2019
Thanks it now installed
But Git-it command doesn’t work and git-it verify
So what the next step please help
I’m using Kali Linux
This comment has been minimized.
Copy link Quote reply
Anthomy1 commented May 30, 2019
I need help.
I’m using Kali Linux.
This comment has been minimized.
Copy link Quote reply
virgilwashere commented Jun 4, 2019
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
Install git on Ubuntu
The most current stable version of Git for Ubuntu.
For release candidates, go to https://launchpad.net/
hub : use github from the command-line
hub is an extension to command-line git that helps you do everyday GitHub tasks without ever leaving the terminal
Hope that helps someone.
This comment has been minimized.
Copy link Quote reply
virgilwashere commented Jun 4, 2019
⚠️ Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL.
If this doesn’t do it, I’d be real careful now.
This comment has been minimized.
Copy link Quote reply
sagynov commented Jun 16, 2019
This comment has been minimized.
Copy link Quote reply
Knlsharma commented Jul 22, 2019
Use this command to check your current Git version: git —version
This comment has been minimized.
Copy link Quote reply
Lucifer8759 commented Jul 23, 2019
I need help.
I’m using Kali Linux.
This comment has been minimized.
Copy link Quote reply
mark-nirdesh commented Dec 17, 2019
I need help.
I’m using Kali Linux.
why use shell ?
use sudo apt-get install git
This comment has been minimized.
Copy link Quote reply
ocBruno commented Feb 14, 2020
Just a heads up!
The Instructions for Windows is linking to the linux instructions
This comment has been minimized.
Copy link Quote reply
CyberChick111 commented Mar 6, 2020
@mithlesh4257 try
sudo apt-get update then sudo apt-get upgrade followed by sudo apt-get install git
This one worked!! Thanks
This comment has been minimized.
Copy link Quote reply
Phontera commented Mar 31, 2020
It worked! Thank you.
This comment has been minimized.
Copy link Quote reply
gprakarsh commented Aug 10, 2020
The link for the Mac Download is outdated. This is the one that should be used —
/bin/bash -c «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)»
This comment has been minimized.
Copy link Quote reply
ASCassinda commented Aug 25, 2020
This comment has been minimized.
Copy link Quote reply
Cyber-Guy24 commented Sep 3, 2020
Thanks mark-nirdesh that worked for me as well
This comment has been minimized.
Copy link Quote reply
wajeehas commented Sep 13, 2020
I have tried installing homebrew via mac os terminal, but it keeps asking me for a password. does anyone know which password this is? it comes up as a key sign.
This comment has been minimized.
Copy link Quote reply
derhuerst commented Sep 14, 2020
I have tried installing homebrew via mac os terminal, but it keeps asking me for a password. does anyone know which password this is? it comes up as a key sign.
It looks like it uses sudo to install itself to a specific location on your computer; sudo requires your password. You will have to put your macOS user’s password.
This is badly designed, it should actually explain why it is using sudo .
This comment has been minimized.
Copy link Quote reply
mahfudivan commented Sep 23, 2020
I have tried installing homebrew via mac os terminal, but it keeps asking me for a password. does anyone know which password this is? it comes up as a key sign.
your laptop password, I use a macbook, I also enter my laptop password
This comment has been minimized.
Copy link Quote reply
temoke-levelops commented Nov 5, 2020
Works for Mac! Where do I give thumbs up?
This comment has been minimized.
Copy link Quote reply
mavaddat commented Dec 19, 2020
why use shell ?
use sudo apt-get install git
They (incorrectly) copied the entire markdown-laden code-block and pasted that into the bash terminal, which of course bash cannot interpret as a command. Do not paste the markdown (e.g., «`shell ) into bash — that part is just for formatting the code on GitHub.
This comment has been minimized.
Copy link Quote reply
AssefaDemeke12 commented Dec 26, 2020
git hub setup for linux
This comment has been minimized.
Copy link Quote reply
Poojap19create commented Mar 26, 2021
I am getting an error while installing git for UBUNTU Can anybody help please
This comment has been minimized.
Copy link Quote reply
mavaddat commented Mar 29, 2021 •
I am getting an error while installing git for UBUNTU Can anybody help please
Your Ubuntu version is no longer maintained. You need to update your distribution to a version that is within its support lifetime. For example, try using this upgrade combination:
Источник