eval "$(ssh-agent -s)"
ssh-add ~/.ssh <SSH PUBLIC/PRIVATE KEY PATH>
- Goto
.git/info/exclude
file - Add your files and save it
git status
ti check changes, ig not changed, then rungit update-index --no-assume-unchanged [<file>|<pattern>]
- Download latest:
git submodule update --init --recursive
- Update latest:
git submodule update --remote --merge
- Remove submodules
# Delete it from .gitmodules
# Update .gitmodules
# Delete from `.git/config`
git rm --cached <sub-module-path>
rm -rf .git/modules/<sub-module-path>
rm -rf <sub-module-path>
git add -u
git reset -- main/dontcheckmein.txt [-- main/*]
git fetch --all --prune
# Add Git branch and color scheme
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
# export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
# EOF GIT BRANCH
git ls-files // List all cached files
git ls-files | grep "env" // Check 'env' on cached files
git ls-files --other --exclude=*.env --ignored // Check whther 'env' file is ignored
Method 1:
Edit file .git/info/exclude
Method 2
git rm --cached <files>
Method 3
git update-index --assume-unchanged path/to/file.txt
git update-index --no-assume-unchanged path/to/file.txt (revert)
rm -f .git/index
git reset
git clean -df // removed untracked directory (d) and untracked files (f)