What is Git?

Spread the love

GitHub offers live trainings with a hands-on, project-based approach for those who love the command line and those who don’t. And if it outputs “origin” you’ve added the remote to your project. Type 2 lets you make a fresh repository from an existing folder on our computer and send that to GitHub. In a lot of cases you might have actually already made something on your computer that you want to suddenly turn into a repository on GitHub. As you can see in the above image, it says that our remote’s name is origin.

For more information, see “Contributing to a project.” This course will teach you the fundamental concepts and key characteristics of Git and how to set up your local environment, track and manage content locally, and how to work in a shared remote repository with other team members. The working tree is a single checkout of one version of the project.These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify. Git added a small header and compressed the original content inside this blob. We can examine the content with the git cat-file command. Passing -t will tell us the type of content while the -p flag will print the contents of that object.

The beginner’s guide to Git & GitHub

Once your new changes have been reviewed by a teammate, or you are satisfied with them, you can merge your changes into the default branch of your repository.To learn more about branching, read “About Branches”. A version control system, or VCS, tracks the history of changes as people and teams collaborate on projects together. As developers make changes to the project, any earlier version git fundamentals of the project can be recovered at any time. So imagine you and your friend are collaborating on a project. Each time you make some changes and push it into the master repo, your friend has to pull the changes that you pushed into the git repo. Meaning to make sure you’re working on the latest version of the git repo each time you start working, a git pull command is the way to go.

git fundamentals

This can be helpful to organize your information and make it easier for others to read. You can also drop in gifs and images to help convey your point! To learn more about using GitHub’s flavor of markdown, read “Basic Writing and Formatting Syntax”. When multiple people collaborate on a project, it’s hard to keep track of revisions — who changed what, when, and where those files are stored. Git is a free, open-source version control software. This tool is a version control system that was initially developed to work with several developers on the Linux kernel.

Plumbing Commands

This lays the foundation for understanding branching and merging related operations, and various other advanced concepts, which we will discuss shortly in the upcoming article. When you git fetch, Git gathers any commits from the target branch that do not exist in your current branch and stores them in your local repository. However, it does not merge them with your current branch. This is particularly useful if you need to keep your repository up to date, but are working on something that might break if you update your files. To integrate the commits into your master branch, you use git merge. Git is an open-source version control system (VCS) that allows software developers to track changes to code over time, including changes made by multiple users.

At the root of it, we’ll have a README.md file and a src directory. Inside src directory, we have a textfile and hello_world.py source file. Therefore, git can take any piece of content, generates a key for it as shown in the hash, and then persist the content in the repository as a blob. Currently, there are no objects except for pack and info subdirectories created as part of initialization. Using the hash-object again with -w the flag will not only return the key but write that object to the .gitstore. The above-generated hash will be used as a key to store that content.

Branching and Merging

Since it’s not about learning the commands, instead it’s about learning the conceptual model. So, instead of learning a bunch of commands, we will try to understand how the commands work. Once we start to understand it, we’ll be more and more comfortable and confident in using the commands, and eventually, we’ll start enjoying it.

git fundamentals

Besides, there is always a geeky pleasure in knowing the internals. For an open source project, or for projects to which anyone can contribute, managing individual permissions can be challenging, but a fork and pull model allows anyone who can view the project to contribute. A fork is a copy of a project under a developer’s personal account.

Knowledge & Skills You Will Learn

Now we can safely ‘push’ our work by the following command. You need to move in it with the following command. Your first mission is to get a copy of the repository on your computer. To do that, you need to “clone” the repository on your computer.