Skip to main content

Git

Browse all articles, tutorials, and guides about Git

36posts

Guides

Posts

DevOps
|14 min read

DORA Metrics From Git History: The Definition Picks Your Tier

We computed deployment frequency, lead time, change failure rate and recovery time from one year of Kubernetes, uv, Go and Prometheus history, once per common definition. The definition alone moved every project across two or three DORA performance levels, and the merge button decides whether Git still knows when the work started.

Git
|14 min read

A Poisoned .git/config Runs Code on git status. We Tested Which Commands and Copies Carry It

On October 2 GitLab disclosed ConfigPoisoning: a repo that brings its own .git/config makes an AI coding tool run attacker commands when it shows a diff. We ran the same trick against plain git 2.39 and 2.55. A bare git status ran repo-supplied programs, the usual safe diff flags missed the clean filter, git 2.54 config hooks walked past core.hooksPath=/dev/null, a clone was clean but a cached workspace was not, and GitHub-hosted runners switch off the ownership check that would stop it.

Git
|11 min read

A Repo per Agent: What Cloudflare Artifacts Changes About Git

Cloudflare Artifacts gives every agent, session or task its own Git repository. We measured how push contention grows when agents share one branch, walked through the Workers API, and priced the pattern so you can decide where it fits.

Git
|12 min read

GitHub Is Removing ssh-rsa Signatures: Find What Breaks Before the November 4 Brownout

GitHub removes the ssh-rsa signature type and diffie-hellman-group-exchange-sha256 on January 13, 2027, with brownouts on November 4 and December 9. Learn which clients and keys are at risk, which debug lines to read, and how to rotate keys before the first brownout.

DevOps
|10 min read

Linux, Git, Docker: Why That Order Matters

Every DevOps roadmap lists the same tools. Almost none of them explain why the order is not arbitrary, or why learning Docker first makes containers feel like magic. Three steps, each one runnable in a terminal, each one making the next one obvious.

DevOps
|9 min read

systemd and NetworkManager Are Trapping AI Agents

Both projects now plant instructions in their repos designed to make an unreviewed AI contribution give itself away. I ran a real agent against each to see what fires, what does not, and what walks straight past.

Git
|11 min read

Stacked Pull Requests on GitHub: What They Actually Fix

GitHub shipped stacked pull requests to public preview. What stacking solves, how the gh-stack workflow works, and when a stack is the wrong shape.

CI/CD
|11 min read

One git push to RCE: the anatomy of CVE-2026-3854 and the parsing bug behind it

A single git push could execute code on GitHub's backend, with cross-tenant reach on github.com itself. The root cause is a bug you almost certainly have somewhere too: untrusted input smuggled through a delimited internal header.

Git
|10 min read

How Can I Delete a Remote Tag?

Learn how to delete Git tags from remote repositories safely. Understand the difference between local and remote tag deletion, and discover best practices for managing release tags in team environments.

Git
|6 min read

Make an Existing Git Branch Track a Remote Branch

Run git branch --set-upstream-to=origin/branch-name (short: git branch -u origin/branch-name). Not on the remote yet? Run git push -u origin branch-name.

Git
|4 min read

How to Clone a Git Repository into a Specific Folder

Want to clone a repository into a custom directory name? Learn how to specify the target folder when cloning Git repositories.

Git
|6 min read

How to Set Git Editor for Commit Messages

Want to use your preferred editor for Git commit messages? Learn how to configure Git to use VS Code, Vim, Nano, Emacs, or any editor of your choice.

Git
|5 min read

Git Clone a Specific Branch with --single-branch

Clone only one branch with git clone -b branch-name --single-branch <repo-url>. Add --depth 1 to download just the latest commit and save more space.

Git
|5 min read

How to Get the Current Branch Name in Git

Need to programmatically get the current Git branch name? Learn multiple methods to retrieve the branch name for scripts, CI/CD pipelines, and shell prompts.

Git
|13 min read

Delete a Commit from a Git Branch: Reset, Rebase or Revert

Remove the last commit with git reset --hard HEAD~1, drop an older one with git rebase -i, or undo a pushed commit safely with git revert <commit-hash>.

Git
|5 min read

How do I Add an Empty Directory to a Git Repository?

Git does not track empty directories by design. Learn practical workarounds to include empty folders in your repository using .gitkeep files and understand why this limitation exists.

Git
|6 min read

How to Update or Sync a Forked Repository on GitHub

Your fork is behind the original repository? Learn how to sync your GitHub fork with the upstream repository and keep it up to date with the latest changes.

Git
|5 min read

How to List All Files in a Git Commit

Need to see which files were changed in a commit? Learn how to list all files modified, added, or deleted in any Git commit using log and show commands.

Git
|10 min read

How to Find and Restore a Deleted File in Git

Accidentally deleted a file and need it back? Learn how to find when a file was deleted and restore it from Git history.

Git
|9 min read

Git File History: View the Changes Made to a File

Run git log --follow -p -- path/to/file to list the commits that changed a file, with patches, across renames. git blame shows who last changed each line.

Security
|10 min read

Pre-commit Hooks for Security: Stop Secrets Before They Hit Your Repository

Once a secret is committed to Git, it lives forever in the history. Pre-commit hooks with gitleaks, detect-secrets, and custom checks catch credentials before that happens.

Terraform
|14 min read

Should .terraform.lock.hcl Be in .gitignore? Checksums and Versions

No: commit .terraform.lock.hcl. Learn what the lock file records, how version constraints work, how to fix checksum mismatch and "Invalid legacy provider address" errors, how to install a specific Terraform version, and which providers manage on-premises servers.

Git
|14 min read

Undo or Abort a Git Merge, and Resolve Merge Conflicts

Undo a merge with git reset --merge ORIG_HEAD, stop one with git merge --abort, resolve conflicts, and fix "refusing to merge unrelated histories".

Git
|6 min read

Git Diff Between Two Branches: Files, Commits and Stats

git diff main..feature shows changed lines, git log main..feature lists commits main does not have, and git diff --stat main feature sums it up per file.

Git
|12 min read

How to Squash the Last N Commits and Change Commit Authors in Git

Squash the last N commits with git reset --soft or git rebase -i, use fixup commits, and fix commit authors with --amend, rebase --exec or a mailmap.

Git
|8 min read

How to Reset Local Git Branch to Match Remote Repository HEAD

Learn different methods to reset your local Git branch to exactly match the remote repository HEAD, including hard reset, fetch and reset, and when to use each approach safely.

Git
|13 min read

How to Push a New Local Branch to Remote Git Repository and Track It

Push a new branch with git push -u origin <branch>, fix "src refspec does not match any", and rename or delete a branch locally and on the remote.

Git
|11 min read

Move the Most Recent Commit(s) to a New Branch with Git

Learn how to move recent commits from your current branch to a new branch using git checkout, reset, and cherry-pick. Fix branch organization mistakes effectively.

Git
|5 min read

Remove a Git Submodule: deinit, git rm and Cleanup

Run git submodule deinit -f path, then git rm -f path, and commit. To delete the leftover Git data too, remove .git/modules/<name>, usually the same path.

Git
|6 min read

How to Undo a Git Rebase with ORIG_HEAD or reflog

Just rebased? Check git log -1 ORIG_HEAD, then run git reset --hard ORIG_HEAD. Otherwise find the old commit in git reflog. Mid-rebase: git rebase --abort.

Git
|10 min read

Git Fetch a Remote Branch and Check It Out Locally

Run git fetch origin branch-name, then git switch branch-name for a local branch that tracks origin/branch-name, or git switch --track origin/branch-name.

Git
|7 min read

How to Stash Only One File in Git

Need to temporarily save changes to just one file? Learn how to stash a single file in Git while leaving other changes in your working directory.

Git
|12 min read

Specify a Private SSH Key for Git, and Show or Change the Remote URL

Choose the SSH key Git uses with core.sshCommand, GIT_SSH_COMMAND or an ~/.ssh/config alias with IdentitiesOnly, and show or change the remote URL.

Git
|5 min read

How to Make Git Ignore File Mode Changes

Git showing chmod changes you don not care about? Learn how to configure Git to ignore file permission changes while tracking actual code changes.

Git
|12 min read

Remove a File from Git Without Deleting It, or Undo git add

Stop tracking a file with git rm --cached and keep it on disk, unstage a file with git restore --staged, and commit only part of a file with git add -p.