How to Upload a Repo on Github
#StandWithUkraine - Stop the Russian invasion
Bring together us and donate. All 2022 volume royalties will be donated to:
Save Life in Ukraine and Ukraine Humanitarian Appeal.
Create a New Repo and Upload Files on GitHub
Now 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 be helpful for several scenarios. Get-go, if you accept to fork a repo, which GitHub allows y'all to practice only in one case, this method volition let you to create additional copies. Second, yous'll demand to upload some of your own files when creating information visualizations using Nautical chart.js and Highcharts templates in Chapter 11 and Leaflet map templates in Chapter 12. Once once more, we'll demonstrate how to do all of these steps in GitHub's beginner-level browser interface, but meet the next section on GitHub Desktop for an intermediate-level interface that's more efficient for working with code templates.
In the previous section, you lot created a copy of our GitHub repo with the Use this template push button, and we intentionally ready our repos with this newer characteristic because it allows the user to make multiple copies and assign each one a unlike name. Many other GitHub repos do not include a Template push button, so to copy those yous'll need to click the Fork button, which automatically generates a copy with the same repo name every bit the original. Just what if you lot wish to fork someone'due south repo a second time? GitHub prevents you lot from creating a second fork to avoid violating one of its important rules: every repo in your business relationship must have a unique name, to avoid overwriting and erasing your work.
So how do yous brand a 2d fork of a GitHub repo, if at that place'southward no Use this template push? Follow our recommended workaround that'southward summarized in these 3 steps:
- Download the existing GitHub repo to your local computer
- Create a brand-new GitHub repo with a new name
- Upload the existing code repo files to your make-new repo
- Click on the Lawmaking > Download Zip drop-down carte push on whatsoever repo, as shown in Figure 10.12. Your browser volition download a zipped compressed folder with the contents of the repo to your local computer, and it may inquire y'all where you lot wish to save it. Decide on a location and click OK.
Effigy ten.12: Click Code and select Download Aught to create a compressed binder of a repo on your computer.
-
Navigate to the location on your computer where yous saved the binder. Its file name should end with
.zip, which means y'all need to double-click to "unzip" or de-compress the binder. Later you lot unzip it, a new binder will appear named in this format,REPOSITORY-BRANCH, which refers to the repository proper noun (such asleaflet-map-elementary) and the branch name (such asprincipal), and it will contain the repo files. I of those files is namedindex.html, which you'll employ in a few steps below. -
Go back to your GitHub business relationship in your spider web browser, click on the plus (+) symbol in the upper-right corner of your account, and select New repository, as shown in Effigy ten.13.
Figure 10.13: Click the plus (+) symbol in upper-right corner to create a new repo.
- On the adjacent screen, GitHub will ask you to enter a new repo name. Cull a short one, preferably all lower-case, and split words with hyphens if needed. Permit'southward proper noun it
practicebecause we'll delete it at the stop of this tutorial.
Check the box to Initialize this repository with a README to simplify the next steps.
Also, select Add a license that matches the lawmaking y'all programme to upload, which in this case is MIT License. Other fields are optional. Click the green Create Repository button at the bottom when washed, as shown in Figure 10.14.
Effigy ten.14: Proper noun your new repo practice, check the box to Initialize this repo with a README, and Add together a license (select MIT) to lucifer any code you program to upload.
Your new repo will have a web address similar to https://github.com/USERNAME/practice.
- On your new repo home page, click the Add File > Upload Files drop-down card button, about the center of the screen, as shown in Figure 10.fifteen.
Effigy x.fifteen: Click the Upload Files button.
- Inside the repo folder that yous previously downloaded and unzipped on your local computer, drag-and-drib the
index.htmlfile to the upload screen of your GitHub repo in your browser, as shown in Figure 10.xvi. Do non uploadLICENSEorREADME.mdbecause your new repo already contains those two files. Scroll downward to click the green Commit Changes push.
Figure 10.xvi: Elevate-and-drib the index.html file to the upload screen.
When the upload is complete, your repo should contain iii files, now including a copy of the alphabetize.html code that you lot previously downloaded from the leaflet-map-simple template. This accomplished our goal of working around GitHub's one-fork rule, by creating a new repo and manually uploading a second copy of the code.
Optionally, you lot could apply GitHub Pages to publish a live version of the lawmaking online, and paste the links to the live version at the top of your repo and your README.md file, as described in the Re-create, Edit, and Host a Simple Leaflet Map Template department of this chapter.
- Since this was only a
practicerepo, allow'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 ten.17. GitHub will ask you lot to type in your username and repo name to ensure that you really want to delete the repo, to prove you lot are non a drunken brownie chef.
Figure x.17: After clicking the Delete Repository button, GitHub will ask you to type your username and repo name to ostend.
And then far, you've learned how to copy, edit, and host code using the GitHub web interface, which is a bang-up introduction for beginners. Now you're ready to move up to tools that will allow you to work more efficiently with GitHub, such as GitHub Desktop and Cantlet Editor, to quickly motion unabridged repos to your local calculator, edit the code, and move them back online.
Source: https://handsondataviz.org/create-repo.html
0 Response to "How to Upload a Repo on Github"
Post a Comment