Git – Create and Delete Repositories
- December 26, 2023
- Posted by: MainInstructor
- Category: Go
Video Title: Git – Create and Delete Repositories
So now I want to look at two ways to create a repository on your local machine to create a local repository the first one is to go to github and get signed in and when you click on your account you can see repositories and then you can create a new repo you can
Give it a description and then we’re gonna leave it as public if you get the free account if you wanted to private if you had a paid account you could do that but this is one that’s important for us initialize this repository with the readme if I
Check that it’s going to create the repository initialize it and put a file in there that you can then clone down to your local desktop ok the repos been created if I click on my name and repositories I can see it and I can click into it and I can see there’s one
File in there now if I open the git bash I like to work from my desktop so I’m going to change onto my desktop I can get clone and then I need to enter a URL and this is the URL right here if I’m using HTTP there’s the URL if I’m using git
There’s the URL we are using SSH so you make sure SSH is selected and there it is so get clone and this is the password for your your SSH keys that you created earlier and now if I LS I can see there’s a test directory there if I look at my desktop
I can see it right here so now adding adding documents and then pushing this back to github becomes very simple let me just add a document here put some information in it save it so now in get if I check the status whoops I can see that I’m not in the the
Repository I’m still in the desktop so I need a CD into the test repository now I can get status and I can see there’s an untracked file and remember our file statuses can be untracked tracked staged and committed right now I’m untracked so I want to get to track this so the way
That you track a file is get add in the file name now in this case git add will track the file and stage the file both remember when a file is staged that means that it’s ready for a snapshot or a commit if I check the status I can see that
There’s changes to be committed and there’s one new file so I can get commit give it a message and the change has been committed if I get status I see there’s nothing else to commit the commit has taken place locally on the local working copy now I want to take these commits and
Push them back to github to the remote repository I can just simply get push origin so github is known as the origin master and the local copy is known as master so it’s get push where do you want to go to origin and what do you
Want to push master from local so origin is github master is the local copy okay and now if I look at github I should see another commit notice there’s one commits now there’s two so that initial commit was when I initialized it when I created that the
Repository and then the second commit is when I added the test file here’s a list of all the files that are in there now if I want to delete a repository I need to actually click into the repository so I was I was in test I’ll go back into
Test and then if I click on the settings while I’m in that repository and I go all the way to the bottom I can delete this repository it wants you to enter the name and then confirm and now that repository is gone I have a second way to add a repository
For that I will just add a repo and give it a name I’m not going to initialize that I’m just going to create it and now it’s just basically an empty folder that’s sitting there here’s my URL for it and notice the URL for SSH is always going
To be the same it’s get at github comm : and then your username forward slash and then the name of the repository dot get so it makes that URL little easier to understand so I’m gonna get out of the I’m in test right now I want to get out
Of there so CD dot dot I want to get into the homework four and now that I’m in homework 4 I want to create the repository so I’m gonna get in it I’m going to initialize the repository if that homework 4 directory was not already created I could right-click and
Do a new and folder on the desktop or I could mkdir make directory space homework 4 then I need to change into that directory so CD into homework 4 and then I can initialize it and after it’s initialized there’s nothing in it I can delete this test now when I check
Get status there is an untracked file so I’m gonna add it and this adds and stages at the same time and so now the file is being tracked so git will watch for changes to it and I’ll go ahead and commit it since it’s staged
So I have a commit I want to push this to the remote repository so the first thing I need to do is add the remote repository so I want to add an Origin or add a remote so it’s git remote add origin and then I need the URL git and
Github and then I can push when I look at it on github I have one commit it’s called second but there’s only one and there’s my file and if I click my file there’s a little bit of text that was in it so there we have two
Ways of adding a repository we can either do it through github initialize it through github clone it down or we can create it from scratch on the local machine we can initialize it on the local machine so if we were on an airplane and we wanted to create a new
Repository we could do that and then when we had connectivity again we can just add the origin and give it and tell it the name the URL and this URL is what what did it should be on github remember we had to create a blank on github and
Then after we’ve added the origin then we can push it and when we push it it’ll make the connection and then for repositories that we no longer need on github we looked at how to delete them by cooking into them and clicking on settings scrolling down and deleting the repository
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99