1 hour ago · Tech · 0 comments

For OSS work, I work with two git remotes: upstream: the canonical OSS project repository, where main is the default branch and is what gets released. origin: a personal fork. All my feature branches live here. I set up locally like this: Fork the project repo to my account. Clone my fork locally, so the origin remote is my fork. Set an upstream remote using git remote add upstream <ssh-url>. and then when working on something, I tend to do these steps: Switch to the main branch with git switch main. git pull from upstream to pick up the latest code. Create a new feature branch from main using git switch -c <branch>. Do work, then commit and push the feature branch to origin. Open a PR from origin/<branch> against upstream/main (usually using gh). Once merged upstream, pull from upstream back into my local main branch and delete my feature branch. The problems I have a couple of little irritations with this workflow that I finally sat down to solve. Firstly, when I git pull on main,…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.