https://github.com/jamescherti/git-smartmv
A tool that decides to use `git mv` or `mv` to move files/directories.
https://github.com/jamescherti/git-smartmv
command-line command-line-tool directories files folders git git-mv move mv
Last synced: 7 months ago
JSON representation
A tool that decides to use `git mv` or `mv` to move files/directories.
- Host: GitHub
- URL: https://github.com/jamescherti/git-smartmv
- Owner: jamescherti
- License: gpl-3.0
- Created: 2023-05-03T19:15:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-23T18:17:58.000Z (12 months ago)
- Last Synced: 2024-11-08T04:09:08.124Z (7 months ago)
- Topics: command-line, command-line-tool, directories, files, folders, git, git-mv, move, mv
- Language: Python
- Homepage:
- Size: 40 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-smartmv - A tool that can decide whether to use `git mv` or `mv`
The `git-smartmv` command-line tool 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` uses `git mv`.
- If the files/directories are being moved between a Git repository and a non-Git directory or a different Git repository, `git-smartmv` uses `mv`.## Installation
Here is how to install git-smartmv system-wide using pip:
```
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] ...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
Copyright (C) 2023-2024 [James Cherti](https://www.jamescherti.com)
Distributed under terms of the GNU General Public License version 3.
## Links
- [Git-smartmv @PyPI](https://pypi.org/project/git-smartmv/)
- [Git-smartmv @GitHub](https://github.com/jamescherti/git-smartmv/)