Tag git
git diff - Git list of staged files - Stack Overflow
Recommended read: git diff - Git list of staged files - Stack Overflow https://stackoverflow.com/questions/33610682/git-list-of-staged-files/33610683#33610683
Ignoring bulk change commits with git blame
Recommended read: Ignoring bulk change commits with git blame https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame
Recommended read: A new hash algorithm for Git https://lwn.net/SubscriberLink/811068/cfeb6a67b8dfbe47/
Backporting/Replaying Changes using git format-patch
and git apply
/ git-am
(2 mins read).
Using git format-patch
and git apply
/git am
to apply a patch, if git cherry-pick
isn't available.
List What Files Changed in a Git Commit (1 mins read).
How to list what files changed in a given commit.
From me it's a no - I see why some people want it, but would rather prefer they stay out of the already limited space in the commit message title, and there's a level of arguable subjectivity of what an emoji means especially as different teams, projects and cultures have views on it.
But then again, so does written language, but I feel that is at least more known?
Zsh prompt with asynchronous Git status
This is an interesting idea - I've not been bitten by it before, but may be worth adding to my dotfiles anyway
Recommended read: Zsh prompt with asynchronous Git status https://vincent.bernat.ch/en/blog/2019-zsh-async-vcs-info
Properly managing your `.gitignore` file
Recommended read: Properly managing your `.gitignore` file https://julien.danjou.info/properly-managing-your-gitignore/
Only Adding Changes for Tracked Files With Git (1 mins read).
How to only add files that have changed with git add -u
.
Specify a specific SSH private key for git pull/git clone
Recommended read: Specify a specific SSH private key for git pull/git clone https://ma.ttias.be/specify-a-specific-ssh-private-key-for-git-pull-git-clone/
Creating a Global .gitignore
(1 mins read).
How to have Git have a list of files to globally ignore, without configuring anything in your ~/.gitconfig
.
Recommended read: My favourite Git commit https://fatbusinessman.com/2019/my-favourite-git-commit
DevOpsDays London 2019 (63 mins read).
A writeup of the DevOpsDays London conference, and the talks and Open Spaces I attended.
Getting git diff
Outputs Without a Prefix (1 mins read).
How to remove a/
and b/
from git diff
outputs.
Pushing your Git Branches to a Matching Remote Branch (1 mins read).
How to save yourself from typing git push --set-upstream origin ${branch}
and have Git determine the branch you're pushing to.
Adding Newlines to all Files in Git (3 mins read).
Adding newlines at the end of all Git-tracked files.
GitHub always have a great recap of the new Git releases, and this is another - I'm particularly interested in some of the changes around git checkout
Recommended read: Highlights from Git 2.23 https://github.blog/2019-08-16-highlights-from-git-2-23/
Debugging the .gitignore file - Kennard
I've not had to debug that many .gitignore files in the past, but it's great to know how I would do it in the future
Recommended read: Debugging the .gitignore file - Kennard https://blog.kennard.dev/2019-06-19-git-debug-gitignore/
Easily rewriting Git URLs from HTTPS to SSH and vice versa (2 mins read).
How to use Git's config to rewrite HTTPS URLs to SSH and vice versa, for repo pushes and pulls.
Using git worktree
to have multiple branches checked out at once (4 mins read).
How to use git worktree
to check out multiple Git branches from the same repo at once.
Using Git refs to help track your GitLab Environments, from your local repo (2 mins read).
How to pull the Git refs that GitLab Environments exposes in your GitLab repo.
Using Git refs to check out GitHub Pull Requests, from your local repo (2 mins read).
How to pull the Git refs for Pull Requests to your GitHub repo.
Using Git refs to check out GitLab Merge Requests, from your local repo (2 mins read).
How to pull the Git refs for Merge Requests to your GitLab repo.
Using git commit --fixup=
to track changes that need to be applied on top of another commit (4 mins read).
Using git commit --fixup=
and git rebase --autosquash
to easily track and squash fix commits.
Backporting/Replaying Changes Using git cherry-pick
(6 mins read).
Using git cherry-pick
to make it easier to backport or replay Git commits across different versions of your codebase.
Safely Force Pushing with Git using --force-with-lease=ref
(6 mins read).
How git push --force-with-lease=ref
can save you from overriding others' changes on shared Git branches.
My editorial workflow for blog posts (8 mins read).
Taking you through the journey I go on when writing blog posts, from ideation to publishing the post.
Viewing Git history of a file in git log
while ignoring file renames (5 mins read).
How to track changes to files in Git without pesky file renames getting in the way, using git log --follow
.
Merging multiple repositories into a monorepo, while preserving history, using git subtree
(3 mins read).
How to merge multiple repositories, with their history, into a single repository, using the git subtree add
command.
Better Git Diff Outputs with Git Submodules (2 mins read).
How to get nicer diff
s when working with submodules.
Clean up your Git branches (3 mins read).
Remove any merged local or branches from your local Git repository.
Viewing your diff while writing your commits with git commit --verbose (3 mins read).
Making it easier to write commit messages by having the diff in your editor.
Saving Repetition with Git Commit Templates (3 mins read).
Speed up your commit message writing by providing a template for when you run git commit
.