# 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] <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
Copyright (C) 2023-2025 [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/)
Raw data
{
"_id": null,
"home_page": "https://github.com/jamescherti/git-smartmv",
"name": "git-smartmv",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.6",
"maintainer_email": null,
"keywords": null,
"author": "James Cherti",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/cc/a1/47ec7ead47bb84ab3e0f454342497a56d95ea6a29c66174b0066516992f3/git-smartmv-1.0.3.tar.gz",
"platform": null,
"description": "# git-smartmv - A tool that can decide whether to use `git mv` or `mv`\n\nThe `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`.\n\nIt can determines whether to use `git mv` or `mv` based on the source and the destination path:\n- If the files/directories are being moved within a Git repository, `git-smartmv` uses `git mv`.\n- 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`.\n\n## Installation\n\nHere is how to install git-smartmv system-wide using pip:\n```\nsudo pip install git-smartmv\n```\n\n## Shell alias\n\nTo simplify the usage of this tool, you can add the following line to your `~/.bashrc`:\n```\nalias mv=\"git-smartmv\"\n```\n\n## Usage\n\nThe `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.\n```\nusage: git-smartmv [--option] <SOURCE>... <DEST>\n\noptions:\n -w WARNING_THRESHOLD, --warning-threshold WARNING_THRESHOLD\n This will raise a warning if the number of files or directories being moved\n exceeds the specified amount\n -v, --verbose Report the names of the files and/or directories as they are being moved.\n -f, --force Force renaming or moving of files and/or directories even if the destination\n exists.\n -p, --non-interactive\n Do not prompt the user to confirm before executing 'mv' and/or 'git mv'\n commands.\n```\n\nFirst example:\n```\ngit smartmv file1 file2\n```\n\nSecond example:\n```\ngit smartmv file1 dir1/ file2 file3 directory/\n```\n\nThird example (non-interactive):\n```\ngit smartmv --non-interactive dir1/ dir2/\n```\n\n## License\n\nCopyright (C) 2023-2025 [James Cherti](https://www.jamescherti.com)\n\nDistributed under terms of the GNU General Public License version 3.\n\n## Links\n\n- [Git-smartmv @PyPI](https://pypi.org/project/git-smartmv/)\n- [Git-smartmv @GitHub](https://github.com/jamescherti/git-smartmv/)\n",
"bugtrack_url": null,
"license": null,
"summary": "A command-line tool that can decide whether to use `git mv` or `mv`.",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://github.com/jamescherti/git-smartmv"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "698cd9a5e5de4b6884bb65cc0dbb8214532eedc9557e09128941ad4d3a12d78a",
"md5": "7b5c09b226be6c651346e0f76e645a7c",
"sha256": "77c0702c60caa680f429c6e44f7562edc3a4158d6aab4f3ea03d533affdbdd9e"
},
"downloads": -1,
"filename": "git_smartmv-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7b5c09b226be6c651346e0f76e645a7c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.6",
"size": 19507,
"upload_time": "2025-02-09T19:10:10",
"upload_time_iso_8601": "2025-02-09T19:10:10.080280Z",
"url": "https://files.pythonhosted.org/packages/69/8c/d9a5e5de4b6884bb65cc0dbb8214532eedc9557e09128941ad4d3a12d78a/git_smartmv-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cca147ec7ead47bb84ab3e0f454342497a56d95ea6a29c66174b0066516992f3",
"md5": "28893ba906afa12b00032b638a3f100a",
"sha256": "33f065920efa356cfd748b2e5df39dcfe5fd534bf1a8d5887889465db52dd21e"
},
"downloads": -1,
"filename": "git-smartmv-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "28893ba906afa12b00032b638a3f100a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.6",
"size": 17469,
"upload_time": "2025-02-09T19:10:13",
"upload_time_iso_8601": "2025-02-09T19:10:13.021212Z",
"url": "https://files.pythonhosted.org/packages/cc/a1/47ec7ead47bb84ab3e0f454342497a56d95ea6a29c66174b0066516992f3/git-smartmv-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-09 19:10:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jamescherti",
"github_project": "git-smartmv",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "git-smartmv"
}