From efe50c2eda0f94f1c66c9ed45ba66657dface4b9 Mon Sep 17 00:00:00 2001 From: Pak Cyberbot <93365275+PakCyberbot@users.noreply.github.com> Date: Sat, 5 Aug 2023 17:01:48 +0500 Subject: [PATCH 1/2] Update git.md Added git submodule and git reflog commands --- source/_posts/git.md | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/source/_posts/git.md b/source/_posts/git.md index 7af12a0..309104e 100644 --- a/source/_posts/git.md +++ b/source/_posts/git.md @@ -370,6 +370,13 @@ Rewrite last commit message ```shell script $ git commit --amend -m "new message" ``` + +Amend the latest commit without changing the commit message. +```shell script +$ git commit --amend --no-edit +``` + + See also: [Rewriting history](https://www.atlassian.com/git/tutorials/rewriting-history) @@ -381,3 +388,54 @@ git config --global alias.ci commit git config --global alias.st status ``` See also: [More Aliases](https://gist.github.com/johnpolacek/69604a1f6861129ef088) + + +Advanced Git +------------ + +### Submodules + +Create a new submodule within your repository: +```shell script +$ git submodule add +``` + +Clone a repository and initialize its submodules: +```shell script +$ git clone --recursive +``` +Update all the submodules in your repository to the latest commit of their respective branches: +```shell script +$ git submodule update +``` + +Pull the latest changes from the remote repositories of the submodules and update them in your main repository: +```shell script +$ git submodule update --remote +``` + +Remove a submodule from your repository: +```shell script +$ git submodule deinit +$ git rm +$ git commit -m "Removed submodule" +``` + +### Cherry-picking +Cherry-picking allows you to apply a specific commit from one branch to another branch. + +```shell script +$ git cherry-pick +``` + +### Reflog + +Display the reflog, showing the history of HEAD and branch movements: +```shell script +$ git reflog +``` + +Find the hash of the lost commit or branch using the reflog and then checkout to that hash to restore it: +```shell script +$ git checkout +``` From 7ff080cb7298b1aa49757ddaa1eba3bd82db91d3 Mon Sep 17 00:00:00 2001 From: Pak Cyberbot <93365275+PakCyberbot@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:01:50 +0500 Subject: [PATCH 2/2] Update curl.md added save cookies option --- source/_posts/curl.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/_posts/curl.md b/source/_posts/curl.md index 6dec53a..8ff85e8 100644 --- a/source/_posts/curl.md +++ b/source/_posts/curl.md @@ -98,7 +98,9 @@ Getting Started -b name=val # --cookie --b FILE # --cookie +-b, --cookie FILE # Load cookies from the specified file for the URL +-c, --cookie-jar FILE # Save cookies to the specified file from the URL + -H "X-Foo: y" # --header --compressed # use deflate/gzip