How to Upload File in Github Desktop
#StandWithUkraine - Cease the Russian invasion
Join us and donate. All 2022 book royalties will be donated to:
Save Life in Ukraine and Ukraine Humanitarian Appeal.
Create a New Repo and Upload Files on GitHub
At present that you've fabricated a copy of our GitHub template, the next step is to learn how to create a brand-new repo and upload files. These skills will exist helpful for several scenarios. First, if you lot have to fork a repo, which GitHub allows you to do only one fourth dimension, this method will allow you to create additional copies. Second, you lot'll need to upload some of your own files when creating data visualizations using Chart.js and Highcharts templates in Chapter xi and Leaflet map templates in Chapter 12. Once once again, we'll demonstrate how to exercise all of these steps in GitHub's beginner-level browser interface, merely encounter the next section on GitHub Desktop for an intermediate-level interface that'southward more efficient for working with code templates.
In the previous department, you lot created a copy of our GitHub repo with the Use this template button, and we intentionally set up our repos with this newer feature because it allows the user to make multiple copies and assign each one a different name. Many other GitHub repos do not include a Template push button, so to copy those you'll need to click the Fork push, which automatically generates a re-create with the same repo name every bit the original. Simply what if you wish to fork someone's repo a second time? GitHub prevents you from creating a 2nd fork to avoid violating 1 of its important rules: every repo in your account must have a unique name, to avoid overwriting and erasing your work.
So how practise you brand a second fork of a GitHub repo, if there's no Apply this template button? Follow our recommended workaround that's summarized in these 3 steps:
- Download the existing GitHub repo to your local calculator
- Create a make-new GitHub repo with a new name
- Upload the existing lawmaking repo files to your brand-new repo
- Click on the Lawmaking > Download Cipher driblet-down card button on any repo, as shown in Figure x.12. Your browser volition download a zipped compressed folder with the contents of the repo to your local computer, and information technology may inquire you where you wish to relieve information technology. Decide on a location and click OK.
Effigy x.12: Click Code and select Download Nix to create a compressed folder of a repo on your computer.
-
Navigate to the location on your computer where you saved the folder. Its file name should end with
.zip, which means yous need to double-click to "unzip" or de-shrink the folder. After you unzip information technology, a new folder will announced named in this format,REPOSITORY-Branch, which refers to the repository proper name (such asleaflet-map-simple) and the branch proper noun (such every bitmain), and it will incorporate the repo files. One of those files is namedalphabetize.html, which you'll use in a few steps below. -
Go back to your GitHub business relationship in your web browser, click on the plus (+) symbol in the upper-correct corner of your business relationship, and select New repository, as shown in Figure 10.13.
Effigy x.13: Click the plus (+) symbol in upper-right corner to create a new repo.
- On the next screen, GitHub will ask you to enter a new repo name. Cull a curt i, preferably all lower-case, and separate words with hyphens if needed. Let's name it
practicebecause we'll delete it at the end of this tutorial.
Bank check the box to Initialize this repository with a README to simplify the next steps.
Also, select Add a license that matches the code you program to upload, which in this case is MIT License. Other fields are optional. Click the green Create Repository button at the bottom when done, every bit shown in Figure ten.14.
Figure ten.14: Name your new repo practice, check the box to Initialize this repo with a README, and Add a license (select MIT) to match any code you plan to upload.
Your new repo will take a web address similar to https://github.com/USERNAME/practice.
- On your new repo home page, click the Add File > Upload Files drop-down carte du jour button, near the eye of the screen, as shown in Figure x.xv.
Figure 10.15: Click the Upload Files button.
- Inside the repo folder that you previously downloaded and unzipped on your local calculator, drag-and-drop the
index.htmlfile to the upload screen of your GitHub repo in your browser, as shown in Figure 10.sixteen. Exercise not uploadLICENSEorREADME.medicobecause your new repo already contains those two files. Scroll down to click the green Commit Changes button.
Figure 10.16: Drag-and-drop the index.html file to the upload screen.
When the upload is consummate, your repo should contain three files, at present including a re-create of the index.html code that yous previously downloaded from the leaflet-map-simple template. This accomplished our goal of working around GitHub's one-fork dominion, by creating a new repo and manually uploading a second copy of the lawmaking.
Optionally, you could use GitHub Pages to publish a live version of the lawmaking online, and paste the links to the live version at the peak of your repo and your README.md file, equally described in the Copy, Edit, and Host a Simple Leaflet Map Template department of this affiliate.
- Since this was simply a
practicerepo, let's delete it from GitHub. In the repo screen of your browser, click the top-right Settings button, scroll all the way down to the Danger Zone, and click Delete this repository, as shown in Figure 10.17. GitHub will ask you to type in your username and repo proper noun to ensure that you really want to delete the repo, to evidence you are not a drunken brownie chef.
Figure 10.17: After clicking the Delete Repository button, GitHub will inquire you to blazon your username and repo name to confirm.
And so far, you've learned how to re-create, edit, and host code using the GitHub spider web interface, which is a great introduction for beginners. Now you lot're prepare to movement up to tools that will allow you to piece of work more efficiently with GitHub, such as GitHub Desktop and Atom Editor, to rapidly motion unabridged repos to your local computer, edit the code, and move them back online.
Source: https://handsondataviz.org/create-repo.html
Enregistrer un commentaire for "How to Upload File in Github Desktop"