Git and Julia Tips for CliMA.Land
Rebase the commits before merging into main
- Switch to the feature branch and make sure you have a clean workspace
git checkout FeatureBranch
git status
to confirm zero uncommitted changes
- Backup current branch to avoid unexpected errors
git checkout -b FeatureBranch_Backup
- Sync the main branch
git checkout main
git pull
- Switch to the feature branch and merge main into it
git checkout FeatureBranch
git status
to confirm zero uncommitted changesgit merge main
- Resolve conflicts and commit them if any
- Reabse the feature branch
git reset origin/main
to rewrite historygit diff
(optional) would show all the changesgit add --all
to add local changes on top of maingit commit -m "Single commit message"
git push -f
to force push because of the re-written history
- Create a Pull Request
- Through the web
- Remove local unnecessary branch (e.g., FeatureBranch_backup)
git branch -d FeatureBranch_Backup
git branch -D FeatureBranch_Backup
to force remove