"Git: Creating a remote repository to an existing project"
Quentin Ducasse.
-Hi. In this video, we are going to have a look
at how we can actually push the counter package that we have online on GitHub.
In order to do so, we already have the MyCounter repository stored locally.
What we are going to do is double-click on it
and go to the MyCounter working copy. We can go to the repository.
What we are going to need is an actual remote.
You can see that we can add a remote. What is a remote?
It is the online counterpart of your local repository.
We are going to need to create this. In order to do so,
you can head to your GitHub page, go to Repositories
and then go over to New to create the MyCounter package.
"A small counter example in Pharo".
We will create this repository.
We now have an empty repository that is going to host
our actual Pharo implementation of the counter. We will go back to Pharo.
This is our repository. You can see that we have 3 commits.
You should have maybe different commits or not the same names.
Basically, you simply have to understand that those commits will be pushed
to the GitHub repository. We go over to the Add remote button.
We need to name it. It is good practice to name it "Origin".
The remote URL can be found here under the HTTPS button.
You can copy and paste this.
Copy and paste. It should be your username
slash the name you gave to the repository. Press Ok.
It is adding the remote.
Now, you can see that we have got a red stamp near the Push button.
This means that there are some changes that have been committed
because we can see that it is up to date,
but they have not been pushed. So let us push them right now. Push.
You can see that it is going to push these 3 commits. Press Ok.
Push. So, it is pushing to Origin.
Since we are using HTTPS, we will need to log into GitHub.
You can store them if you plan on using it again. Ok.
It is pushing to Origin.
Now it should be done.
We can see that the red stamp near the Push button has disappeared,
so let us head over to GitHub.
Let us refresh the page.
You can see that we now have our project.
If you go into src, you can see our MyCounter package,
we can see the different classes. Everything is now hosted on GitHub.
This is the way you can add a remote to your locally saved project.