trying to wean myself off zsh's helpful git aliases __ __ .-----.|__| |_ | _ || | _| |___ ||__|____| |_____| removing something if you committed before add to .gitignore ============================================================ https://stackoverflow.com/a/9750651/105282 To stop this you have to do : git rm -r --cached .idea/ adding a remote (if it get zapped) ================================== # if you have a clone of the repo, this should help with the git url git remote -v git remote add origin ssh://user@host:/path/to/repo find when a file was commited ============================= git log --diff-filter=A -- src/library/textfiles/irc.txt removing files from git ======================= warning1: git-filter-repo may zap your remotes, make a note of them warning2: git-filter-repo warns you that it expects a clean repo which i did not have and might have caused warning1. # on debian (and clones) install as a package sudo apt install -y git-filter-repo # we want to remove random.txt in data directory of our current repo git-filter-repo --path src/random.txt --invert-paths git push -f synology as a git server ======================== assumption: you have installed git service on your synology and created a share called /volume1/GitRepos creating the repo ----------------- ssh into synology with a git enabled user # create a bare repo cd /volume1/GitRepos mkdir hello-world cd hello-world git init --bare clone the repo -------------- git clone ssh://user@host:/volume1/GitRepos/hello-world