From the course: Git Essential Training (2023)
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Initialize a repository locally and sync it to the remote repository
From the course: Git Essential Training (2023)
Initialize a repository locally and sync it to the remote repository
- [Instructor] So let's look at a different scenario. Let's say we have an empty remote repository and we have some code already in our local environment, and we want to push that to the remote repository. As you see here, I made a repository that I did not initiate, so there's no README in there. There's no code at all. As you see, the web interface is already helping me with options to set this up. But let's see how we do it in Visual Studio Code. For now, I will copy the URL as I'll need it later. I'll open Visual Studio Code. Now, this file at this point is just a local folder. Let's change it into a local Git repository. We do that by using git init. We now have an empty repository. Let's add that file we've created. So I'll use Git add dot to add everything to the staging area and then I'll commit it using git commit, m for the message. And then I'll use initial commit, which is often to the default message we use…
Contents
-
-
-
-
-
-
Set up a remote repository2m 30s
-
(Locked)
Clone the remote repository1m 21s
-
(Locked)
Create a file and stage it1m 27s
-
(Locked)
Commit a file1m 8s
-
(Locked)
Push the file to the remote repository57s
-
(Locked)
The .git folder1m 37s
-
(Locked)
Initialize a repository locally and sync it to the remote repository2m 33s
-
(Locked)
Challenge: Push your first code41s
-
(Locked)
Solution: Push your first code40s
-
-
-
-