Pushing data to an remote repository in Git

Let's prepare and push our first commit to our test remote repository on GitHub.

Let's create a file test.txt and index it:

terminalgit add test.txt

Let's commit:

terminalgit commit -m "first commit"

Now let's send our commit to an remote repository. To do this, use the push command, in which after the -u flag, the name of the remote repository and the name of the branch we are sending are specified after a space:

terminalgit push -u origin master

After executing the command, the terminal will ask you to enter your GitHub login and the token we created in the previous lessons (you only need to enter it the first time). After entering the token, all your commits that are not yet on the server will be sent.

If you then go to your project on GitHub, you will see files with your code there.

Задание 1

Make your first commit to your project and push it to an remote repository. Find your project on GitHub and make sure the changes appear there.

Задание 2

Make changes to the project. Make a few more commits. Push your changes to an remote repository.