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<<<  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"



How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.