From 66081fffb3073525c5762fe3be6e851ad576ba27 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 13 Jun 2023 02:41:22 +0200 Subject: [PATCH] Update page '6-12-2023 Cohort 2 Sync Notes' --- 6-12-2023 Cohort 2 Sync Notes.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 6-12-2023 Cohort 2 Sync Notes.md diff --git a/6-12-2023 Cohort 2 Sync Notes.md b/6-12-2023 Cohort 2 Sync Notes.md new file mode 100644 index 0000000..15aead1 --- /dev/null +++ b/6-12-2023 Cohort 2 Sync Notes.md @@ -0,0 +1,23 @@ +1705h: started +* Mentioned that you can use `git pull --rebase` if 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* + +1740h: ended \ No newline at end of file