![]() Regardless of whatever system you use, now is a good time to start replacing any hardcoded instances of master and replace it with a more dynamic reference so that changes to the default branch are transparent to you. Up = !"git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed git fetch -prune git pull" bashrc, I’ve replaced these branch-specific aliases:Īlias updatemaster='git checkout master & git fetch origin -prune & git fetch origin -tags & git pull origin master'Īlias updateprod='git checkout production & git fetch origin -prune & git fetch origin -tags & git pull origin production'Īlias updateorigin='git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed & git fetch origin -prune & git fetch origin -tags & git pull origin $(git symbolic-ref refs/remotes/origin/HEAD | sed for my VS Code setup on Windows, where I use a PowerShell terminal instead of WSL/bash, my. Git symbolic-ref refs/remotes/origin/HEAD | sed can integrate this into any other aliases or scripts you have. The good news is that the default branch isn’t just a “thing you know”, it can be extracted dynamically from a git repo. A lot of tutorials I see include scripts and aliases that depend on the default branch name being master, and those tools may be broken now, leaving you and your users with some issues after the migration is completed server-side. As you may have heard by now, the default git branch name is changing from master to main in most git software ( GitHub, BitBucket, GitLab, etc.) to drive out some divisive terminology.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |