Once you give a branch the big D () its gone, its lost from your history. It's completely removed from your log. Ther...
Posts tagged: git
All posts with the tag "git"
It's nearly impossible to completely loose a file if it is commited to git. It's likely harder to fully remove the fi...
Git commands such as , , all take a flag called . This can filter for only certain types of diffs, such as added (A),...
Git has a built in way to rebase all the way back to the beginning of time. There is no need to scroll through the lo...
Git reflog can perform some serious magic in reviving your hard work from the dead if you happen to loose it.
Right inside the git docs, is states that the command runs by default which is an alias for
I've never found a great use for a global file. Mostly I fear that by adding a lot of the common things like files it...
Fugitive comes with a pretty sick way to commit files and see the diff at the same time with verbose commit. Opening ...
Code Review from the comfort of vim | Diffurcate
I often review Pull requests from the browser as it just makes it so easy to see the diffs and navigate through them, but there comes a time when the diffs get really big and hard to follow. That’s when its time to bring in the comforts of vim.
This all stems from the great plugin by AndrewRadev. It breaks a down into a project. So rather than poping into a pager from git diff, you can pipe to diffurcate and it will setup a project in a tmp directory for you and you can browse this project just like any other except it’s just a diff.
...
Git in Depth Notes
These are my notes from taking @nnja’s FEM course git-in-depth.
How I configure git
Git can be a bit tricky to get configured correctly. I often stumble into config issues weeks after setting up a new machine that I did not even notice. These are my notes to remind me how I configure git.
How to use git cherry pick
Trim unused git branches
Gitui is a blazing fast terminal git interface
Gitui is a terminal-based git user interface (TUI) that will change the way that you work with git.
Gitui is a blazing fast terminal git interface
Gitui is a terminal-based git user interface (TUI) that will change the way that you work with git. I have been a long-time user of the git cli, and it’s been hard to beat, mostly because there is nothing that keeps my fingers on the keyboard quite like it, except gitui which comes with some great ways to very quickly walk through a git project.
Go to their [releases]https://github.com/extrawurst/gitui/releases) page, download the latest build, and pop it on your PATH. I have the following stuffed away in some install scripts to get the latest version.
install latest release
...
Fix git commit author
I was 20 commits into a hackoberfest PR when I suddenly realized they they all had my work email on them instead of my personal email 😱. This is the story of how I corrected my email address on 19 individual commits after already submitting for a PR.
stop the bleeding
Before anything else set the email correctly!
...
List the latest files to change in a git repo
Strip Trailing Whitespace from Git projects
A common linting error thrown by various linters is for trailing whitespace. I most often use flake8. I generally have [pre-commit](https://waylonwalker.com/pre-commit-is-awesome hooks setup to strip this, but sometimes I run into situations where I jump into a project without it, and my editor lights up with errors. A simple fix is to run this one-liner.
bash
git grep -I --name-only -z -e '' | xargs -0 sed -i -e 's/[ \t]\+\(\r\?\)$/\1/'
...
Rename your Master Branch
Master No More
It’s been a long time coming. We use some very harsh language within tech so much sometimes that we become numb to it. It’s time to do my very small part in this movement and purge this language from my active repos starting with this blog right here.
Large Refactor At The Command Line
this post follows my method of refactoring code bases from the command line, read more about that in this article.
...
