Git Fundamentals

You can add specific people as reviewers of your pull request which shows you want their feedback on your changes! Once a pull request is ready-to-go, it can be merged into your main branch.To learn more about pull requests, read “About Pull Requests”. We see one commit in the commit history but Inside the objects directory, we see the various objects being created.

git fundamentals

Note that in general, Alice would want her local changes committed beforeinitiating this pull. This creates a new directory myrepo containing a clone of Alice’srepository. The clone is on an equal footing with the originalproject, possessing its own copy of the original project’s history. Suppose that Alice has started a new project with a Git repository in/home/alice/project, and that Bob, who has a home directory on thesame machine, wants to contribute. In this tutorial you will understand what Git is and how to use it on the remote repository platforms, like GitHub.

Step 1: Make sure you have Git installed on you machine.

A repository is where your project work happens–think of it as your project folder. It contains all of your project’s files and revision history. You can work within a repository alone or invite others to collaborate with you on those files. But mastering Git isn’t just about memorizing commands and executing them robotically. It’s about understanding the underlying principles, developing best practices, and learning from both successes and failures. It’s about transforming Git from a tool you use to a skill you wield with confidence.

If you are instead primarily interested in using Git to fetch a project,for example, to test the latest version, you may prefer to start withthe first two chapters of The Git User’s Manual. For new users, using the terminal view can seem a bit complicated. We will keep it really simple, and learning this way gives you a good grasp of how Git works.

Dealing with Maven dependencies when switching to Git

If we want to start using Git, we need to know where to host our repositories. This makes using Git a joy because we know we can experiment without the danger of severely screwing things up.For a more in-depth look at how Git stores its data and how you can recover data that seems lost, see Undoing Things. Is a quick way to search just the files that are tracked by Git. This will again prompt you for a message describing the change, and thenrecord a new version of the project. Insert the missing part of the command to check which version of Git (if any) is installed. Now go edit the README.md file to provide information about the repository.

With this, we got the overall gist of how the git object model works. Once this is absorbed, understanding further complex operations like merging, rebasing, and branching strategies become very intuitive. To summarize, a commit points to a tree (signifying root), and this tree points to a blob (README.md file), and another tree (src directory). The blob is just a piece of content present inside the README.md file. Let’s create an example project to understand each one in-depth.

Want to create a customised learning path for your team?

You can use your profile to let future employers know all about you! To learn more about your user profile and adding and updating your profile README, read “Managing git fundamentals Your Profile README”. A repository (or “Repo” for short) is a project that contains multiple files. In our case a repository will contain code-based files.

Now that we know what Git is and it’s basic terminologies, let’s see how we can place a file under git. We’re going to do it the right way and the difficult way. A repository a.k.a. repo is nothing but a collection of source code.