Tech, compressed

Small tutorials on various development/sysadmin tools

Ignoring Files - Intro to Git part 6

Sometimes you don’t want git to track files in a repository. Maybe you’re working on a Java project and you want Git to silently ignore all files ending in .class. Or maybe it’s a C program and you want Git to ignore *.o. Either way, there are two ways to accomplish this. The gitignore file Git has a few special files that you can use to affect how Git operates. One of these is the ....

February 8, 2021 · 3 min · Kian Kasad

Checking Out - Intro to Git part 5

In the previous tutorial, the checkout subcommand was used to switch betweeen branches, but there’s a lot more that it can do. “Checking out” is how you switch between different points of the repository’s history. You can checkout branches, tags, and commits. Tags Tags are just named pointers to commits (with optional extra data). They’re usually used for marking versions of software, which makes it really easy to jump between versions in a git repository....

December 1, 2020 · 3 min · Kian Kasad

Branching and Merging - Intro to Git part 4

If you’ve followed along with the previous tutorials, you now know how to work with commits, stage files, view the commit log, and maybe a few other things. Now it’s time to use one of git’s most useful features: branching. What is a branch? In reality, a branch is just a named pointer to a commit. But for most purposes, thinking of a branch like a branch of a tree is fine....

August 28, 2020 · 3 min · Kian Kasad

Staging Areas - Intro to Git part 3

What are staging areas? When you run git status after modifying some files, you’ll see something like this: On branch master Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: file1.txt modified: file8.txt Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: file2.txt modified: file4.txt Untracked files: (use "git add <file>....

August 25, 2020 · 5 min · Kian Kasad

Basic Commands - Intro to Git part 2

Installing Git You can find Git in basically every package manager in existence. If you don’t use a package manager, you can get git from the official downloads page. This tutorial uses git version 2.x.x. Check which version you have by running $ git --version Creating a repository To create a git repository in the current directory, use the init subcommand: $ git init This command will create the .git directory with the following structure (or similar):...

August 23, 2020 · 4 min · Kian Kasad