A command-line tool that can decide whether to use `git mv` or `mv`.
Project description
git-smartmv - A tool that can decide whether to use git mv
or mv
The git-smartmv
command-line tool, written by James Cherti,
allows moving files and/or directories without having to worry about
manually choosing whether to use git mv
or mv
.
It can determines whether to use git mv
or mv
based on the source and the
destination path:
- If the files/directories are being moved within a Git repository,
git-smartmv
usesgit mv
. - If the files/directories are being moved between a Git repository and a
non-Git directory or a different Git repository,
git-smartmv
usesmv
.
Installation
sudo pip install git-smartmv
Shell alias
To simplify the usage of this tool, you can add the following line to
your ~/.bashrc
:
alias mv="git-smartmv"
Usage
The git-smartmv
command-line tool accepts similar arguments as the mv
command, including the source file or directory to be moved, and the
destination file or directory.
usage: git-smartmv [--option] <SOURCE>... <DEST>
options:
-w WARNING_THRESHOLD, --warning-threshold WARNING_THRESHOLD
This will raise a warning if the number of files or directories being moved
exceeds the specified amount
-v, --verbose Report the names of the files and/or directories as they are being moved.
-f, --force Force renaming or moving of files and/or directories even if the destination
exists.
-p, --non-interactive
Do not prompt the user to confirm before executing 'mv' and/or 'git mv'
commands.
First example:
git smartmv file1 file2
Second example:
git smartmv file1 dir1/ file2 file3 directory/
Third example (non-interactive):
git smartmv --non-interactive dir1/ dir2/
License
Distributed under terms of the GNU General Public License version 3.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for git_smartmv-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50aed5db948037d6c1c2f0e3c431eca3da29faf615a83e4bff682522bfbf6139 |
|
MD5 | 0020477f6e7b6aea1dbfd05c7a3c0b3c |
|
BLAKE2b-256 | 26916af2025755b8064f1ac0034e5641d3f557ed1c5fbc0b5d131b446d4fd797 |