Keeping forks and branches up to date?
One thing you might find about Git is that you end up with a bunch of different things that fall behind the latest, and you need to keep pulling in new changes all the time.
Staying up to date: via self-improvement
However, the more you use git, the less you'll probably pull
. The main reason is that your workflows will improve. The operative principle will be of working atomically, meaning, in small, internally coherent units.
In a branching workflow, you pull from the origin:master
, and then you checkout a new branch. Because your work is atomic, it only affects a single file, or the same section of many files, and is unlikely to conflict with someone else's work. Because you are a git expert, you can also work quickly, which helps avoid conflicts too.
- Using branches for small, discrete tasks
- New branch for every new task
- Changing only what needs to be changed (i.e. make new branch called typos if you really need to fix a typo in the README)
- Working quickly and effectively (turning new branch into new merge request as quickly as is reasonable)
Once you do these things a few times, you'll realise the 'overhead' of creating a fork/branch and creating a merge request at the end only takes a few seconds. And it's always very satisfying to make merge requests, since it's the point where your problem becomes somebody else's.
Staying up to date: via self-destruction
The main alternative to keeping forks/branches up to date is simply deleting them, and starting anew each time you need to. This makes sense for us in most cases, there's no harm in deleting a fork rather than letting it go stale, and then just creating a new fork when a new issue arises. All the forks and branches of things can weigh on you like guilt, cleaning them up periodically will feel nice.
So after you have something merged, try out deleting your fork via the forked repository's settings. When there aren't many forks left, I'll close this issue!