DEV Community

Cover image for How to learn Git from scratch
Matvey Romanov
Matvey Romanov

Posted on

How to learn Git from scratch

How does Git differ from other version control systems?

Hi there!

Storing information

CVS, Subversion, Perforce, and other centralized platforms store information as a changelog for files. In contrast, Git considers data to be a set of casts of a small file system.

image
The principle of data storage in Git

image
The principle of storing data in other systems

Among other features:

  • unlike centralized systems, Git uses only local files and resources for most operations, which makes it possible to work without network access;
  • before saving the file, Git calculates the checksum using the SHA-1 hash, and it becomes its index.

How to use it?

Firstly, you need to install Git, then configure it. Specify:

  • user name: $ git config --global user.name "ra1nbow";
  • email address: $ git config --global user.email ra1nbow@example.com;
  • a text editor to work with. For example, if the standard editor does not suit you and you chose Emacs: $ git config --global core.editor emacs;
  • built-in comparison utility. For example, if you want to use vimdiff $ git config --global merge.tool vimdiff. Then check the settings: git config --list.

How to work with code?

Use the services for project hosting and collaborative development. They usually have access control, bug tracking, task management, a wiki for each project, and a developed community where you can ask for advice.

Among the most popular platforms:

What to learn next?

  • Working with repositories: creating, recording changes, viewing commit history, undoing changes, working with remote repositories and tags.
  • Branching and merging.
  • Git on the server: configuration, working with protocols, generating a public SSH key, GitWeb, Gitosis, Gitolite, Git daemon, Git hosting.
  • Git tools.

Where to learn?

A little interactive:

  • site with search for any shell commands, including Git commands.

I learned everything, what's next?

When you have mastered the basic operations:

Hope you enjoyed my post! Follow my Github <3

Top comments (1)

Collapse
 
bobbyiliev profile image
Bobby Iliev

Make sure also to check out this open-source eBook. It has everything that you need to get started and is not too overwhelming for beginners:

GitHub logo bobbyiliev / introduction-to-git-and-github-ebook

Free Introduction to Git and GitHub eBook

πŸ’‘ Introduction to Git and GitHub

This is an open-source introduction to Git and GitHub guide that will help you learn the basics of version control and start using Git for your SysOps, DevOps, and Dev projects. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you can use Git to track your code changes and collaborate with other members of your team or open source maintainers.

The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Git, GitHub and version control in general.

πŸš€ Download

To download a copy of the ebook use one of the following links:

πŸ“˜ Chapters

  • About the book
  • Introduction to Git
  • Version Control
  • Installing Git
  • Basic Shell Commands
  • Git Configuration
  • Introduction to GitHub
  • Initializing a Git project
  • Git Status
  • Git Add
  • Git…