2
6 12 2023 Cohort 2 Sync Notes
j edited this page 2023-06-13 02:42:52 +02:00
1705h: started
- Mentioned that you can use
git pull --rebaseif the commits in the repository won't conflict with local changes and commits - Rebase is different from the default merge because it rewrites history
- You can't use rebase on commits that have left your local computer (pushed somewhere)
- Explained using the example of the California Statutes (commits) on top of the California Codes (repository)
- To avoid this, never do the following operations in this order:
- TODO @j come up with a better example of how to rewrite a pushed commit
-
pull
-
someone else changes something in the repository
-
commit
-
push
-
commit <-- this is where it breaks
-
pull --rebase
-
push
-
- There are other ways to break it, but the general rule is never rebase a commit that you pushed
- You can always use
git pull --rebaseif you haven't pushed any commits between now and your last pull
1750h: ended