Category: Git
- list untracked files, deleted, modified, etc:
git ls-files
- remove deleted files from git:
git ls-files -d | xargs git rm
- change from https to ssh:
git remote set-url origin git@bitbucket.org:sysopsteam/chef.git(<<< change this)
- restore one file:
git checkout server.rb
- diff working copy and remote head:
git diff origin/master HEAD
- restore a file that was deleted from the repo:
git checkout $(git rev-list -n 1 HEAD -- "some-users")^ -- "some-users"
Tags:
Git