git posts

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.

Continue reading post "git: MacOS default branch now “main”?"

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.

Continue reading post "Git info alias"

I don’t know why I didn’t realize this before, but git project versions can be managed just with tags rather than needing to create a branch for each point version. Packagist can go entirely by tags. I had been creating point version branches because Symfony does, but that’s really only needed if you need to continue updating a previous version. It’s overkill for small, one person projects. With a tag available, it wouldn’t be hard to create a branch later anyway if needed.