GitHub platform Archives - SoftUni Global https://softuni.org/tag/github-platform/ Learn Programming and Start a Developer Job Wed, 30 Mar 2022 10:43:34 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.3 https://softuni.org/wp-content/uploads/2022/04/cropped-SoftUni-Global-Logo-Square-notext-32x32.png GitHub platform Archives - SoftUni Global https://softuni.org/tag/github-platform/ 32 32 What is Git and How to Work with GitHub? [Dev Concepts #28] https://softuni.org/dev-concepts/what-is-git-and-how-to-work-with-github/ https://softuni.org/dev-concepts/what-is-git-and-how-to-work-with-github/#respond Mon, 31 Jan 2022 06:00:00 +0000 https://softuni.org/?p=11150 In this article of the series Dev Concepts, we take a look at Source Control Systems, Git, and GitHub.

The post What is Git and How to Work with GitHub? [Dev Concepts #28] appeared first on SoftUni Global.

]]>

Git is the most popular source control system in modern software development. It is a powerful tool for version control and team collaboration at the source code level.

One of the main tasks for source control systems is to keep the source code and other project assets in a shared repository. The information there is available through the Internet or in a local environment. The team that works on the specific repository can clone, pull, commit, and push the local changes. If there are conflicting changes, they can fix and merge them in the end. If the developers have a problem with a specific commit, they can compare different versions of the same file and restore previous versions.

github-coverIn our video, we work with Git and GitHub by showing a few examples. First, we clone the repository, edit a local file, commit the local changes, and then publish the commit. If you haven’t worked with Git, first you need to install it. You can download it from here. To skip the process of creating a repository, we will be working with a sample repository: 

We start the system console (which is also called “terminal window” or “command prompt“). Then, we clone the sample repository to a local directory, using the “git clone” command.

git clone https://github.com/SoftUni/playground

That will create a local copy of the specified repository in the “playground” subdirectory in the current directory.

Now we modify а local file, for example, the file “README.md“. We can use a text editor of choice, such as “Notepad“. We can open the file with Notepad by typing the following command:

notepad README.md

After you add a new line in the file, save it. Now we have a modified file on the local disk. The changes are only made on your local device. If we want to add the changes to the local repository, we type the following command on the command prompt:

git add . & git commit -m “Added something”

We now have a local repository that holds changes. They are still not sent to GitHub. To send the local commits to the remote repository at GitHub, we can execute the following command:

git push

This command needs the current Git user to have permission to write on the remote repository. It may ask for your username and password for authentication. If you are not registered yet, you can do it from here.

After the command compiles successfully, we can open the repository from the GitHub website and see the changes. We can also review the commits history. GitHub stores all the commits and we will know if someone deletes our changes.

github-architecture

To sum it up, the source control system keeps the source code in a remote repository. We can clone, edit, commit and push to the origin repositories. The workflow allows different team members to work together on a shared source code.

Lesson Topics

In this tutorial we cover the following topics:
  • Source Control Systems
  • Git and GitHub

Lesson Slides

The post What is Git and How to Work with GitHub? [Dev Concepts #28] appeared first on SoftUni Global.

]]>
https://softuni.org/dev-concepts/what-is-git-and-how-to-work-with-github/feed/ 0