How To Download File Using Git In Windows
If you've ever used GitHub earlier, you know that it'south not immediately clear on how to download files from the platform. It's one of the more than complicated platform, as it isn't direct meant for straight file sharing, but for development instead. Granted, one of the big things about GitHub is that all of the public repositories are open up source, and people are encouraged to contribute — there are private repositories, just these are mostly used for evolution purposes inside businesses that don't desire their code seen by the public. GitHub, however, still handles downloading files differently than other places.
And then if you're not entirely sure how you can download files from projects (or unabridged projects) from GitHub, nosotros're going to show you how. Let'due south go started.
Downloading a File From GitHub
Near public repositories can be downloaded for gratuitous, without even a user account. This is considering public repositories are considered to be codebases that are open source. That said, unless the possessor of the codebase checks a box otherwise, their codebase can be downloaded onto your reckoner, packed into a .zip file.
- So, if you go to a public codebase — such as this Tip Calculator that I congenital — y'all'll observe that in the height-correct corner is a green button that says Clone or Download, click on the button.
- Then, in the dropdown, select Download Nix. All of the files volition begin downloading to your computer, usually in your Downloads folder.
- Then, open your Downloads folder on your computer and find the Cypher file. You'll want to right-click it and choose the option that says Excerpt All…, Unzip, or Uncompress, and then select a folder where you want the files to end upwards.
- Finally, navigate to that selected folder, and you'll detect all of those Github files that nosotros downloaded right there!
That's a fairly small codebase, with merely a couple of files in it. If yous go to Wes Bos' JavaScript 30 repository on Github, you'll notice that — since information technology is a public repository — it can exist downloaded the same way.
Downloading GitHub Files Using Commands
Alternatively, you tin easily clone a file or repository using a few simple commands on GitHub. For this to piece of work, yous'll need to install the Git tools. We're going to exist installing the aforementioned tip calculator from the control line in this demo.
- Re-create the URL from your accost bar or from the same card where yous downloaded the nada file from.
- Open up Git Bash, type in "cd Downloads" and hitting Enter. This will accept you to the Downloads folder in the command window, yous tin as well type whatsoever file location you desire to relieve the file in.
- At present, type in "git clone https://github.com/bdward16/tip-calculator.git"and striking Enter.
- Using this method, the files are automatically unzipped when downloaded.
In that location's a Better Way to Download Files
While the manner we outlined is simple and straightforward, it'due south well-nigh optimal for merely viewing the code files, not experimenting. If you lot're planning on downloading GitHub files to experiment with, the all-time way would be to "fork" the project. A fork is just your ain copy of a repository.
Forking a repository comes with a number of benefits. It gives you your own re-create on your GitHub account that allows you to freely experiment with changes without affecting the original projection. For example, you could observe a issues in my Tip Calculator or desire to add together your own features. And then, you could "fork" my Tip Calculator, creating a copy on your GitHub account. Here, yous could mess around the code and experiment with information technology without affecting the original project, because this would be your copy or "fork."
Most commonly, forks are used to either advise changes to someone else's project, like fixing a problems or adding a feature as nosotros mentioned.
And then, how practice yous fork a public repository? Information technology's actually quite easy. Before we get started, yous need to create a free GitHub account, every bit you'll demand somewhere to store your fork. Yous tin head to www.github.com and do this right now.
Once yous have your account created, you tin can fork a public repository to your account.
- For instance, yous tin can head over to the public repository for Wes Bos' xxx Days of JavaScript training form, and in the superlative-correct corner, you lot'll see a push button that says Fork. Click the push.
- It could take a couple of seconds to a few minutes, just GitHub will then clone or "fork" that project over to your ain GitHub account. Once it's washed, it'll immediately show you lot the project under your GitHub username.
- To verify, you can click on your profile icon in the navigation bar at the top-right, then select the pick that says Your Repositories . In your list of repositories, yous should see the JavaScript 30 course codebase.
Now, y'all tin can alter and experiment with the code all y'all want, and it won't affect the original project files of the original possessor. If you lot alter some code, fix a bug, or add a new feature, you can create something called a "Pull Request," where that alter tin 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
Every bit yous can encounter, downloading files and whole projects from GitHub is really quite like shooting fish in a barrel. In but a couple of minutes, yous can have an entire projection downloaded onto your calculator, or even forked to your ain GitHub account. Information technology doesn't accept much to mess effectually with the code in your fork to see what affects what, and then eventually, you might even be able to create your outset pull request! Happy coding!
How To Download File Using Git In Windows,
Source: https://www.alphr.com/download-files-github/
Posted by: springponly1993.blogspot.com

0 Response to "How To Download File Using Git In Windows"
Post a Comment