Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam installs the GitHub CLI with Homebrew and logs in, then asks Claude, in manual mode, to create a private GitHub repo and push the project to it, explaining why the repo should be private and where to check when GitHub or Claude is down.
What you'll learn
- The GitHub CLI (
gh) lets Claude work with GitHub from the terminal; install it withbrew install gh(Homebrew is "that App Store for engineers"). - Check the install with
gh help; log in once withgh auth login(GitHub.com, browser, HTTPS, one-time code). - If setup goes wrong, ask Claude Code to troubleshoot: old installs on your Mac can get in the way.
- Restart Claude Code after installing new tools and start the session in the project folder.
- Ask for a private repo; secrets should never end up on GitHub, even in a private one. You can switch a repo's visibility later.
- Manual mode shows each command (for example
gh repo create <name> --private) before it runs. - If GitHub or Claude behaves oddly, check GitHub's status page and status.claude.com.
- A repo's address is github.com/username/repo-name.
Chapters
- 00:00Installing the GitHub CLI
- 02:46Logging in to GitHub with gh
- 04:08Asking Claude for a new repo
- 05:39Why your repo should be private
- 06:48Claude checks and creates the repo
- 09:08Checking the status pages
- 11:06Your project on GitHub
- 00:00Okay, so with the Git and GitHub basics covered, let's try to push our local repository to GitHub.
- 00:08So first, I'm going to go into GitHub and I'm going to make sure I'm signed in or sign up if I don't have an account.
- 00:16So allow me to sign in first.
- 00:21Okay, I am signed in.
- 00:23And then with that, I want to go back to my desktop and I'm going to open up a terminal.
- 00:29And this is because once we have a GitHub account, we also need to install GitHub specific tools.
- 00:36So we've already installed like Git tools at the very beginning of the course that came together with our Homebrew installation.
- 00:47And by the way, Homebrew is also something that we've installed that we are going to be using right now.
- 00:51Remember, it's that App Store for engineers.
- 00:54We're going to go into that App Store and we are going to download a GitHub CLI, so terminal tools.
- 01:03This is so that our cloud agents can use these tools in their terminals on our machine.
- 01:09So with that, I have my terminal open up.
- 01:12Let me just remind myself of the command.
- 01:14Okay, and it's brew install gh.
- 01:18Okay, I'm going to make a little bit of an just so that we can see it clearly.
- 01:22Brew install gh. Again, these commands are going to be available wherever you're watching this video.
- 01:29Okay. It's going to auto update Homebrew apparently.
- 01:34Right, and it's going to download things and we are done.
- 01:40We have GitHub tools installed on our computer.
- 01:45So with GitHub tools, I'm going to type in clear.
- 01:48With GitHub tools installed, we also need to guess what?
- 01:51Authenticate, right? As with everything else.
- 01:53So with that, I am going to maybe first of all do gh help uh just to double and make sure that um the GitHub tools are really installed here
- 02:04uh and because I can see this response it is you know sort of a confirmation that uh we have these gh tools installed.
- 02:12Um if you run into any issues at any point don't hesitate to reach out to your Claude Code desktop and let it walk you through and troubleshoot whatever you
- 02:21see on your uh on your screen right now.
- 02:24This is important because um if you had any uh attempts at you know working with with the code before on your machine you might not even remember chances are
- 02:34there are already some you know setups or installations on your computers that might be now uh be causing some troubles.
- 02:42So just a tip like if you run into any troubles don't worry just let Claude Code walk you through it okay?
- 02:48Uh and with that I'm going to do um gh auth uh login and um it's going to ask me how I want to authenticate.
- 02:56I want to authenticate with github.com uh I'm going to log in with a browser and I'm going to use the https as the method of authentication.
- 03:05I'm going to confirm by just uh pressing Y on my keyboard uh and then pressing enter.
- 03:12I'm going to copy this one time code here uh command C and I'm going to hit enter to let terminal open up this page for me.
- 03:21I'm going to hit continue.
- 03:23I'm going now paste this code and I'm going to hit continue again.
- 03:28Uh I'm going to confirm that I do authorize uh this CLI tool to have access to my GitHub account.
- 03:34Uh this is ultimately how we are going to be creating repositories, pushing code and all that stuff.
- 03:40So I'm going to hit authorize and I'm all set.
- 03:44I'm going to go back to the terminal.
- 03:46It's going to take uh sometimes a couple of seconds but after a while you should see your username and a confirmation that we have logged in as uh well
- 03:55Toilet Runner in my case again um I don't think I want to go into uh uh of like where what is the origin of that nickname.
- 04:04Um okay. So with the uh GitHub tools installed, just as a good measure, what I'm going to do is I'm going to close my uh Claude Code uh desktop
- 04:13application. I'm also going to close the terminal.
- 04:16I'm going to relaunch Claude Code.
- 04:19Um and I'm going to uh open up a new conversation.
- 04:23Again, make sure you are in the Tonik parking course or whatever is the name of your project folder.
- 04:28It is important that we like start a new session with Claude Code in that particular folder.
- 04:34I don't really need Opus 5.5 for this.
- 04:36I'm going to select Sonnet 5.5 and um I'm going to uh you know what?
- 04:43Actually, I'm going to stick with the manual mode um just so that we can see everything that's happening because what we are about to do right now is we
- 04:49are going to ask Claude to help us push our folder to a remote repository on GitHub.
- 04:56And because we don't have any remote repository on GitHub yet, we are also asking uh we're also going to ask it to create one for us, okay?
- 05:03So uh really simple.
- 05:05Um Claude um I would like you to help me push this local uh repository or local folder or local repository uh oh sorry uh to GitHub and set up
- 05:21a new uh remote repo for this which I haven't created yet.
- 05:29I want to make sure my GitHub repository or repo for short um is going to be private.
- 05:39That is pretty important.
- 05:40There are two ways uh well like basically you can either make your GitHub repo public or private.
- 05:47Um some beginners uh make this mistake of uh like creating public repositories and um pushing files with their you know secrets uh or like environmental keys uh and things
- 06:02that could be uh like used to like create some or generate some really nasty charges.
- 06:11So make sure to mention that we are interested in creating or setting up a private GitHub repository.
- 06:18You can always switch it back by the way.
- 06:20It's not that it's set in stone, okay?
- 06:22So I'm going to hit send.
- 06:24Again, keep in mind I'm using Sonnet model because it's a pretty straightforward thing to do.
- 06:29We're just going to let Claude do it for us.
- 06:32Okay, so Claude wants to obviously check whether we have the GitHub command line tools installed and whether we are signed in, which is exactly what we did.
- 06:41Let's see if it's going to if it's going to like confirm it.
- 06:47[sighs] Oh, this is nice.
- 06:50So it's also going to check if we already have any secret files in our repo.
- 06:55Now I know we don't have any secret files.
- 06:59We are going to talk about these a little bit later in the course.
- 07:01So these environmental keys that I mentioned, like typically even though you have a private GitHub repo, you really don't want these secrets to ever ever like end up on
- 07:12GitHub. You want to keep them in different places, okay?
- 07:16But yeah, sometimes people like get forgetful and they would like push a file with a secret key.
- 07:23It's better to have, you know, a private repo.
- 07:26At least that's what you can do.
- 07:30Okay, the repo is clean.
- 07:31It has no remote yet, which is confirmed.
- 07:34The remote meaning that repository on GitHub.
- 07:37It has no secret files tracked.
- 07:38Yes. The GitHub check timed out.
- 07:41Okay, I do have some network issues here.
- 07:44So let's try that again.
- 07:48And Claude has confirmed that I have signed in as Toilet Granny and that I can create repos.
- 07:55It's going to create a private repository named after my folder and it's going to push the code to it.
- 08:01Perfect, which is exactly what we want.
- 08:03And by the way, again, this is how like it's a nice thing about this manual mode every now and then because like if you want to get a bit
- 08:10more comfortable working with a terminal or code yourself manually you can always have look at like what are the commands that you could have like totally be pasting or
- 08:23writing yourself in the terminal.
- 08:24So it's it would be gh repo create the name and then the private flag and you know let's clot let clot do it for us this time okay?
- 08:34So I'm going to allow once.
- 08:38Now it's verifying whether the repository is private and whether it's synced.
- 08:41Now if this is the first time you're doing this and you have plenty of files in your folder this might take a while because literally what is happening is
- 08:52you know we are uploading these files right now onto GitHub.
- 08:55So depending on your internet connection you might want to give it a second.
- 09:00But this this is a very simple lightweight folder.
- 09:04Okay let's verify again.
- 09:11So this is taking a little bit longer than usual and I suspect it might be because of our internet connection issues today in the office so bear with me.
- 09:21Luckily I can just you know cut this part out so hopefully you'll whenever get to hear these words.
- 09:28Okay it's going to check whether the network works.
- 09:31[laughter] Okay so yeah yeah I do have these network issues here so let's let's try it again.
- 09:41Hopefully it works this time around.
- 09:46And it has failed again.
- 09:50Okay. So right as I am recording this I'm not sure when you are watching this but at the day of recording this there is this Microsoft outage global.
- 10:05I'm wondering if it affects GitHub.
- 10:06I don't think it it should but let let us like let's, let's have Claude do that proper diagnosis.
- 10:16And, um, let's see.
- 10:19Uh, what I'm going to do in the meantime, I'm going to do a GitHub status, simple online search just to make sure everything works.
- 10:28Uh, it's a like thing you can do as well.
- 10:30Uh, if GitHub works or behaves, uh, in a weird way, you can always visit this page.
- 10:36If Claude ever uh, behaves in an unpredictable way, another cool URL to remember is status.cloud.
- 10:45I typed in AI, but it reroutes to com.
- 10:48And as we can see, there are, uh, [laughter] there are some elevator errors on with Claude.
- 10:54And yeah, there are these problems with Microsoft 365.
- 10:58Um, okay. So let's see.
- 11:03It's going to make another attempt, it seems.
- 11:05This is taking a little bit longer than it should really.
- 11:10Okay, the repository has been created because of my internet connection issues.
- 11:15Um, you know, it was a bit more convoluted than it should be.
- 11:19Um, but uh, Claude has confirmed um, that the the repo has been created.
- 11:23It's private and it seems it has just pushed um, it has pushed everything to GitHub.
- 11:32So let's go ahead and see.
- 11:33I 'm going to open up this URL.
- 11:35I'm going to open it up in Google Chrome.
- 11:37Um, and like generally, um, like to find any repository on GitHub, you will probably very quickly discover this pattern.
- 11:46It's slash your username slash your repository name.
- 11:50And we can confirm everything here is exactly as I had this on my computer, which is great, which means now we are um, basically protected.
- 11:58If anything happens to my computer, I have this uh, online backup on GitHub and I can keep now not only committing my work, but also committing and pushing it
- 12:09out there. So with that, we are ready to move on to the next video.
- 12:13Thank you. I'll see you in the next one.