Currently our git repository is only locally, but there are many reasons why it would make sense to
use a service such as GitHub to backup our work.
It also makes it easier to collaborate with others that are working on the same project.
You don't have a GitHub account?
Go to github.com, click on sign up.
It is free to create an account and it only takes two minutes.
Once you log into your account, try to locate the button that allows you to create a new repository.
This is where we'll be storing our code within GitHub.
I'm going to call my repository flashcards.
I'm going to leave it public, and I want to make sure that nothing here in terms of initializing the
repository is enabled, such as adding a Readme file or adding a git ignore or something like that.
So let's go ahead and create a repository.
Now we're going to see our repository.
And from the options available we're going to select https.
Copy this link here and then jump into cursor inside cursor.
We're going to create a prompt asking the agent to push the local changes to this remote repository.
So there are a few git commands that need to be executed.
And this is where the interesting part actually comes when we're using the command git remote add.
So now we are adding this remote repository.
I'm going to run this command.
And now is the part when we are actually pushing these changes to the remote repository.
So this is another command that's going to be executed.
And now we have a GitHub extension within Visual Studio Code that wants to talk with the GitHub server
in order to authenticate this request.
So I'm going to go ahead and click on allow.
And we're going to go ahead and copy and continue to GitHub.
This will open up a browser window.
Click here on continue selecting the account that you have.
And the next step involves pasting the code that you have already copied from cursor.
So this is just about pasting the information there and clicking on continue.
And now we're going to authorize Visual Studio Code to do these changes.
Remember cursor is based on Visual Studio Code.
So this is why we're going to see here that this is identifying itself as Visual Studio Code.
So I'm going to click here on authorize.
So now we are all set.
Let's go back to cursor.
So what we can see here now is a success message saying that the changes have been pushed to the main
branch and to this specific repository.
So anytime we want to push changes that we have committed locally, we can just tell cursor to do that
for us.
And if we're taking a look inside our repository we're refreshing this repository called flashcards.
We're going to see here all the files that we have as part of our project.
So now we have an additional bucket.
Our code is now integrated with GitHub.
And this opens up many other possibilities.