share two functions for file operations in the background

I’d like to share some functions for file operations in the background.

Smart move file and dirs:

  1. use git mv in a git repo, works well with git (and git-annex)
  2. use rsync for non git controlled files
  3. does not break relative symlinks

Smart copy file and dirs:

  1. use hardlink for files on the same file system
  2. use rsync for files on different file systems
  3. does not break relative symlinks

Here is the link: https://gist.github.com/QiangF/00825d4f1e28b53d45bbf5efb526c95d