Cyan Hall C H
Created by Last updated: 11/25/2020 👉   Get the meaning of Git command: just copy it and paste to explainshell

1. Stats of submission

    git shortlog -sne

2. List log in fancy style (from [email protected])

    git log --all --graph --decorate --oneline

3. Change the default commit editor

    git config --global core.editor `which vim`

4. Edit the last commit message

    git commit --amend

5. Commit case-sensitive only filename changes

    git config core.ignorecase false

6. Unmodifying a Modified File

    git checkout -- [path/filename]

7. List existing remotes

    git remote -v

8. Set new remote url

    git remote set-url origin [repo_url]

9. List all branch

    git branch -a

10. Change current branch

    git checkout [branch_name]

11. Merge branch

    git merge [branch_name]

12. Create temporarily workspace

    git stash
git stash list
git stash pop

13. Move to the specific commit

    git reset --hard [commit_hash]

14. Using submodule

    git submodule add url
git submodule init
git submodule update

15. Clone repo with submodule

    git clone --recursive [url]