git commit --amend --author="[NAME] <[EMAIL]>" --no-edit
git filter-branch --commit-filter ‘
if [ “$GIT_COMMITTER_EMAIL” = “[OLD_EMAIL]” ];
then
GIT_COMMITTER_NAME="[NAME]";
GIT_AUTHOR_NAME="[NAME]";
GIT_COMMITTER_EMAIL="[NEW_EMAI]L";
GIT_AUTHOR_EMAIL="[NEW_EMAIL]";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
git config --global push.default current
git push -u origin [BRANCH]
git stash save —keep-index
$ mv a/submodule a/submodule_tmp
$ git submodule deinit -f -- a/submodule
$ rm -rf .git/modules/a/submodule
$ git rm -f a/submodule Note: a/submodule (no trailing slash)
Source: git - How do I remove a submodule? - Stack Overflow
Note: You can change name by using user.name
in place of user.email
$ git config --global user.email “[EMAIL]“
$ git config user.email "[EMAIL]"
$ git commit -m "[MESSAGE]" —allow-empty
$ git clone --bare https://github.com//exampleuser///old-repository/.git
$ git push —mirror https://github.com//exampleuser///new-repository/.git
$ vi ~/.gitignore
Example
.idea/
*.sublime-project
.DS_Store
$ git clean -xfd
Source Remove files from Git commit - Stack Overflow
$ git reset —soft HEAD~1
$ git reset HEAD [FILE]
$ git commit -c ORIG_HEAD
$ git status --ignored