git reset --soft Head~3
git commit -m ' Project Created'
git push --force origin main
git submodule add [url] [path](src/...)
git submodule update --init --recursive --remote
After change password run below command:
git config --global credential.helper wincred
Log show indented branch-points and merges
git log --graph --pretty=format:' %Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
git branch -D < branchname>
git push origin --delete < branchname>
Create branch from unpush commit on main
git checkout -b < branchname>
Create upstream for a branch
git push -u origin < branchname>
list stack-order of stashed file changes
write working from top of stash stack
discard the changes from top of stash stack
Have Git in WSL use your Windows credentials
git config --global credential.helper " /mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe"
Reset commit but keep the changes
Resolving the issue for running git command very slow in wsl. Function must added to ~/.bashrc
function git() {
if [[ $( pwd -P) = /mnt/* ]]; then
git.exe " $@ "
else
command git " $@ "
fi
}