An interesting problem I encountered when moving to use Linux more is that git aliases are often run in POSIX sh instead of the terminal in use, such as bash or zsh. A few of my aliases are complex enough to require running an external shell command, ie using !. Some of those have complex comparisons or verify with the user what they are doing. I had long used some bashisms to simplify these, and didn’t have problems on my Mac, which uses bash as the sh implementation, but had problems in Ubuntu, which uses dash.
git posts
Bumping version tags with git
It is common to use git tags to manage software version numbers. Such tags are often done with a “v” followed by the version, eg “v1.2.3”. I decided I wanted to make managing these a little easier, so I made a git alias to make a new tag with the next version for me.
Continue reading post "Bumping version tags with git"Github repo backup script
For some time, I’ve been wanting to set up a backup for my Github repos. Technically they are all backed up by my local copies, which are also backed up when I back up my local computer. However, I wanted something that was sure to have everything from all the repos (all branches, tags, etc) and could be set up and run continuously on a yet-to-be-created backup server. I have create a bash script to do this for me.
Continue reading post "Github repo backup script"git: MacOS default branch now “main”?
At some point recently, git init on my Mac has started to default to the branch name “main”. It did this for a repo I created today, but not for one created August 29th, so maybe Apple made a change in an update sometime between then and now. I haven’t been able to find anything about the change on the web though.
Git info alias
I do a lot of management of work and personal projects with git. I’ve been making shell and gitconfig aliases to make things that I do often quicker or to store logic of things that I won’t remember easily. One recent one that I really like is a git info (or g i) alias that shows status and a number of other bits of information about the repository quickly with one command. I’ve been using it in place of status most of the time.
I had a weird loss of a git commit when my battery died unexpectedly.
Continue reading post "#2520"Change git commit
To edit a git commit somewhere before the last one, use rebase with the commit hash (via StackOverflow answer):
Continue reading post "Change git commit"Created a github repo for the Ansible / Vagrant setup I made for my site when I moved to VPS.
Continue reading post "#1538"10k Apart: Updated
I got an update link for my 10k Apart project on the 22cnd. I already had some updates committed, so I soon-after clicked the link. It wasn’t until yesterday that the update finally applied. So it was quite a relief when it finally did.
Continue reading post "10k Apart: Updated"Almost lost some work with git. I was using git reset --hard to rewrite some history, but I forgot that I had some unstaged changes. Luckily, I had stashed it previously and still had the call in my terminal buffer, so I was able to get the object ID and apply it after verifying it was the right one with git stash -p show $ID.