levi durfee

git

Keeping Your Branch Up-to-Date with Git: Merge vs Rebase

tech git branch
When working on a feature branch, it’s essential to keep it up-to-date with the latest changes from the main branch. This helps prevent conflicts and ensures a smooth merging process when it’s time to integrate your changes. In Git, you can achieve this using either git merge or git rebase. But which one should you choose? Git Merge: The Safer Option git merge is a straightforward way to incorporate the changes from the main branch into your feature branch. Read more...

Reverting Extra Changes without Squashing Commits

tech git revert
When working with Git, it’s not uncommon to make mistakes or introduce unnecessary changes. If you’ve committed changes that you later regret, you might want to revert them without losing the commit history. One common approach is to use git reset --hard or git rebase -i to squash or rewrite the commit history. However, this can be problematic, especially if others have already cloned or forked your repository. In this scenario, you want to create a new commit that reverts the extra changes, effectively “reseting” the state of your repository to a previous point. Read more...
1 of 1