From 398fa38b1a07c4ce649881dd7fe6077f7b4c4d2c Mon Sep 17 00:00:00 2001 From: radinpirouz Date: Tue, 13 Jan 2026 00:09:57 +0330 Subject: [PATCH] git doc : update git docuemnt (not cleaned) --- Code-Management/Git/main.md | 75 +++++++++++++++++++++++++++ Linux/Basic Administration/30-diff.md | 20 +++++++ 2 files changed, 95 insertions(+) create mode 100644 Linux/Basic Administration/30-diff.md diff --git a/Code-Management/Git/main.md b/Code-Management/Git/main.md index bcd3f12..a2e9d62 100644 --- a/Code-Management/Git/main.md +++ b/Code-Management/Git/main.md @@ -97,6 +97,14 @@ To view the commit history of your repository: ```bash git log ``` +show diffrent on each commit +```bash +git log -p +``` +show last 3 commit +```bash +git log -3 +``` *You can press `q` to exit the log view.* @@ -108,6 +116,10 @@ To see changes made to files before staging them: git diff ``` +```bash +git diff --staged +``` + ### 4. Staging Individual Files If you want to stage specific files instead of all changes: @@ -159,3 +171,66 @@ To merge changes from another branch into your current branch: ```bash git merge ``` + +rename file +```bash +git mv +``` + +remove file +```bash +git rm +``` + +change default editor +```bash +git config --global code.editor "vim" +``` + +edit last commit message +```bash +git commit --amend +``` + +show changes in commit +```bash +git show +``` + +```bash +git revert HEAD +``` + +```bash +git revert +``` + +```bash +git branch +``` + +```bash +git branch -v +``` + +```bash +git branch -d +``` + +```bash +git checkout +``` + +```bash +git checkout -b +``` + +```bash +git merge +``` +on merge with have 2 method: + +fast forward: if we are on latest on master and create branch and set some change and merge it ( master not changed ) commit on out branch fast come on head master + +3way:if we are on latest on master and create branch and set some change and merge it but this time our master got some change if our brnach dont have conflict with master its merge but with new commit + diff --git a/Linux/Basic Administration/30-diff.md b/Linux/Basic Administration/30-diff.md new file mode 100644 index 0000000..4e8c122 --- /dev/null +++ b/Linux/Basic Administration/30-diff.md @@ -0,0 +1,20 @@ +diff : + + +```bash +diff file1 file2 +``` + +```bash +diff -y file1 file2 +``` + +```bash +diff -u file1 file2 +``` + + + +```bash +diff -u file1 file2 > diffrent +``` \ No newline at end of file