How to Upload Files to Github After Creating Repository
#StandWithUkraine - Stop the Russian invasion
Join us and donate. All 2022 book royalties will be donated to:
Save Life in Ukraine and Ukraine Humanitarian Entreatment.
Create a New Repo and Upload Files on GitHub
Now that you've made a re-create 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. Kickoff, if you have to fork a repo, which GitHub allows yous to exercise only one time, this method will allow yous to create additional copies. Second, you lot'll demand to upload some of your own files when creating data visualizations using Chart.js and Highcharts templates in Chapter 11 and Leaflet map templates in Chapter 12. One time again, we'll demonstrate how to do all of these steps in GitHub'due south beginner-level browser interface, merely come across the next department on GitHub Desktop for an intermediate-level interface that's more efficient for working with code templates.
In the previous section, yous created a copy of our GitHub repo with the Utilize this template button, and nosotros intentionally prepare our repos with this newer feature because it allows the user to brand multiple copies and assign each i a different name. Many other GitHub repos practice not include a Template button, so to copy those you lot'll need to click the Fork push, which automatically generates a copy with the aforementioned repo proper name equally the original. But what if yous wish to fork someone'south repo a 2nd time? GitHub prevents you 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 practise you lot brand a second fork of a GitHub repo, if there's no Use this template push? Follow our recommended workaround that'due south summarized in these three 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 brand-new repo
- Click on the Code > Download Zip drop-down menu button on any repo, as shown in Effigy x.12. Your browser will download a zipped compressed folder with the contents of the repo to your local computer, and it may inquire yous where you wish to save it. Decide on a location and click OK.
-
Navigate to the location on your reckoner where you saved the folder. Its file proper name should finish with
.zip
, which means you need to double-click to "unzip" or de-shrink the folder. Later you unzip information technology, a new folder will appear named in this format,REPOSITORY-BRANCH
, which refers to the repository name (such asleaflet-map-simple
) and the co-operative name (such every bitmain
), and it will contain the repo files. One of those files is namedalphabetize.html
, which you'll use in a few steps below. -
Go back to your GitHub account in your web browser, click on the plus (+) symbol in the upper-right corner of your account, and select New repository, as shown in Figure 10.thirteen.
- On the next screen, GitHub will inquire yous to enter a new repo name. Choose a short one, preferably all lower-case, and separate words with hyphens if needed. Let'southward proper name it
practise
because we'll delete information technology at the stop of this tutorial.
Cheque the box to Initialize this repository with a README to simplify the next steps.
Likewise, select Add a license that matches the lawmaking yous plan to upload, which in this case is MIT License. Other fields are optional. Click the green Create Repository button at the bottom when done, as shown in Figure x.xiv.
Your new repo will have a spider web address similar to https://github.com/USERNAME/exercise
.
- On your new repo habitation page, click the Add together File > Upload Files drop-downwardly menu push, nigh the middle of the screen, equally shown in Figure ten.15.
- Within the repo folder that you previously downloaded and unzipped on your local calculator, drag-and-drop the
index.html
file to the upload screen of your GitHub repo in your browser, as shown in Figure 10.xvi. Practise non uploadLICENSE
orREADME.doc
because your new repo already contains those two files. Curlicue down to click the green Commit Changes button.
When the upload is consummate, your repo should contain iii files, now including a copy of the index.html
code that you previously downloaded from the leaflet-map-simple
template. This achieved our goal of working effectually GitHub's 1-fork dominion, by creating a new repo and manually uploading a second copy of the code.
Optionally, you could use GitHub Pages to publish a live version of the code online, and paste the links to the alive version at the meridian of your repo and your README.md file, equally described in the Copy, Edit, and Host a Simple Leaflet Map Template department of this chapter.
- Since this was only a
practice
repo, let'due south delete it from GitHub. In the repo screen of your browser, click the tiptop-right Settings push button, scroll all the fashion downward to the Danger Zone, and click Delete this repository, as shown in Figure x.17. GitHub will ask yous to type in your username and repo name to ensure that you really want to delete the repo, to evidence you lot are not a drunken brownie chef.
So far, you've learned how to copy, edit, and host code using the GitHub web interface, which is a smashing introduction for beginners. Now yous're ready to motion up to tools that will allow you to piece of work more than efficiently with GitHub, such equally GitHub Desktop and Atom Editor, to speedily move unabridged repos to your local computer, edit the code, and move them back online.
Source: https://handsondataviz.org/create-repo.html
Belum ada Komentar untuk "How to Upload Files to Github After Creating Repository"
Posting Komentar