diff --git a/Tips And Tricks/git.txt b/Tips And Tricks/Git merge or rebase.txt similarity index 65% rename from Tips And Tricks/git.txt rename to Tips And Tricks/Git merge or rebase.txt index 0c16971..cf46f09 100644 --- a/Tips And Tricks/git.txt +++ b/Tips And Tricks/Git merge or rebase.txt @@ -1,4 +1,4 @@ -Nice — here’s the commit graph diagram you asked for. This shows how your history looks depending on whether you merge or rebase. +This shows how your history looks depending on whether you merge or rebase. ⸻ @@ -10,11 +10,11 @@ Your branch: A──B──C──D──E─────────┴─M ↑ Merge commit (M) - • You branched from commit C. - • You added commits D and E. - • Upstream added commits after C. - • When you git merge upstream/main, Git creates a merge commit (M) joining both histories. - • History shows branching + merging — good for context but can look messy. +• You branched from commit C. +• You added commits D and E. +• Upstream added commits after C. +• When you git merge upstream/main, Git creates a merge commit (M) joining both histories. +• History shows branching + merging — good for context but can look messy. ⸻ @@ -47,14 +47,14 @@ A──B──C──F──G──H──D'──E' ⸻ D) When to use what - • Merge → - • If you want to preserve the “real” history (showing when branches diverged). - • Safer for beginners (no rewriting commits). - • Good for long-lived feature branches. - • Rebase → - • If you want a clean, straight line history. - • Preferred in open-source PR workflows. - • Requires confidence resolving conflicts & force-pushing. +• Merge → +• If you want to preserve the “real” history (showing when branches diverged). +• Safer for beginners (no rewriting commits). +• Good for long-lived feature branches. +• Rebase → +• If you want a clean, straight line history. +• Preferred in open-source PR workflows. +• Requires confidence resolving conflicts & force-pushing. ⸻ @@ -75,12 +75,9 @@ git rebase upstream/main # fix conflicts if needed git push origin feature-branch --force-with-lease - ⸻ So: Merge = “historical diary” (records exactly what happened). Rebase = “rewrite the story” (makes it look like you developed cleanly on top). ⸻ - -Want me to also sketch a real-life example with commit hashes (like abc123, def456) so you can see how git log looks different between merge and rebase? \ No newline at end of file diff --git a/Tips And Tricks/Jar File Java.txt b/Tips And Tricks/Jar File Java.txt index 26306e1..10c8f5e 100644 --- a/Tips And Tricks/Jar File Java.txt +++ b/Tips And Tricks/Jar File Java.txt @@ -6,17 +6,17 @@ metadata into a single file. A JAR makes it easy to distribute Java libraries, applications, and resources as one portable unit. Key characteristics: - • ZIP-based archive (.jar). - • Contains compiled .class files, resource files (properties, images), and an optional META-INF/MANIFEST.MF. - • Can be executed (if it contains a Main-Class entry in the manifest) or used as a library on the classpath. +• ZIP-based archive (.jar). +• Contains compiled .class files, resource files (properties, images), and an optional META-INF/MANIFEST.MF. +• Can be executed (if it contains a Main-Class entry in the manifest) or used as a library on the classpath. Why JAR files are important - • Distribution — package everything needed (classes + resources) into one file for easy sharing and deployment. - • Reproducibility — stable artifact that can be versioned and archived. - • Classpath management — simplifies dependency handling (one file instead of many loose class files). - • Security & Integrity — supports signing (JAR signing) and manifest metadata. - • Performance — fewer filesystem entries and easier I/O handling; commonly used by class loaders. - • Tooling compatibility — all build tools (Maven, Gradle, Ant), application servers, and the JVM understand JARs. +• Distribution — package everything needed (classes + resources) into one file for easy sharing and deployment. +• Reproducibility — stable artifact that can be versioned and archived. +• Classpath management — simplifies dependency handling (one file instead of many loose class files). +• Security & Integrity — supports signing (JAR signing) and manifest metadata. +• Performance — fewer filesystem entries and easier I/O handling; commonly used by class loaders. +• Tooling compatibility — all build tools (Maven, Gradle, Ant), application servers, and the JVM understand JARs. Basic JAR layout