Compare commits

...

7 commits
v5.8 ... master

Author SHA1 Message Date
Bhupesh-V 38b7be7335 🔖 release 5.9
Some checks failed
build / Linux Test (push) Has been cancelled
2025-04-13 14:41:16 +05:30
Bhupesh-V 2b0936d813 add support for recovering multiple uncommited deleted files (#79) 2025-04-13 14:40:43 +05:30
allcontributors[bot] fc4e473fa2
docs: add luxxmr as a contributor for doc (#78)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2025-03-18 14:12:13 +05:30
luxxmr 43c205e315
README.md file update to include the "git-undo" command conflict with git-extra. (#77) 2025-03-18 14:11:17 +05:30
Bhupesh Varshney 019646b1ed
add docker pulls 2024-02-07 14:42:34 +05:30
Bhupesh-V ab99ea6110 🐛 my bad, forgot grep (used by undo git rm) 2024-02-06 23:41:00 +05:30
Bhupesh Varshney 8f6e7218da
add package status 2024-02-05 13:47:04 +05:30
4 changed files with 40 additions and 7 deletions

View file

@ -127,6 +127,15 @@
"contributions": [
"code"
]
},
{
"login": "luxxmr",
"name": "luxxmr",
"avatar_url": "https://avatars.githubusercontent.com/u/185298948?v=4",
"profile": "https://github.com/luxxmr",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,

View file

@ -35,6 +35,7 @@ COPY --from=ugit-ops /usr/bin/xargs /usr/bin/
COPY --from=ugit-ops /usr/bin/cut /usr/bin/
COPY --from=ugit-ops /usr/bin/tr /usr/bin/
COPY --from=ugit-ops /bin/bash /bin/
COPY --from=ugit-ops /bin/grep /bin/
# copy lib files

View file

@ -5,8 +5,8 @@
<a href="https://github.com/Bhupesh-V/ugit/actions/workflows/build.yml">
<img alt="build ugit" src="https://github.com/Bhupesh-V/ugit/actions/workflows/build.yml/badge.svg">
</a>
<a href="https://github.com/Bhupesh-V/ugit/blob/master/LICENSE">
<img alt="License: MIT" src="https://img.shields.io/github/license/Bhupesh-V/ugit" target="_blank" />
<a href="https://hub.docker.com/r/bhupeshimself/ugit">
<img alt="Docker pulls" src="https://img.shields.io/docker/pulls/bhupeshimself/ugit?logo=docker" target="_blank" />
</a>
<img alt="total downloads (github + brew)" src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Bhupesh-V/6b7b8e8576bc1ca237bffd9a344672ab/raw/ugit-downloads.json">
<a href="">
@ -104,6 +104,10 @@ docker run --rm -it -v $(pwd):/app bhupeshimself/ugit
- [**fzf**](https://github.com/junegunn/fzf) >= `0.21.0` - [Installation guide](https://github.com/junegunn/fzf#installation)
- GNU utils like `awk`, `grep`, `tput` etc
<br>
[![Packaging status](https://repology.org/badge/vertical-allrepos/ugit.svg)](https://repology.org/project/ugit/versions)
### Linux
@ -188,6 +192,15 @@ If you're using [oh-my-zsh](github.com/robbyrussell/oh-my-zsh):
`source ~/.zshrc`
### Note on `git-undo` Command Conflict
If you have both `ugit` and `git-extras` (https://github.com/tj/git-extras) installed, be aware that both provide a `git-undo` command. This can lead to conflicts, as only one version of the command will be accessible at a time. To resolve this:
- **Using Homebrew**: Homebrew will notify you of the conflict during installation. You can choose to unlink the conflicting formula or use the --overwrite flag to force the link as follows:
`brew link --overwrite ugit`
- **Manual Installation**: Ensure that the `git-undo` command from the desired package is prioritized in your system's PATH.
## Please read ⚠️
@ -259,6 +272,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Theotime812"><img src="https://avatars.githubusercontent.com/u/45947878?v=4?s=100" width="100px;" alt="Théotime Maillarbaux"/><br /><sub><b>Théotime Maillarbaux</b></sub></a><br /><a href="https://github.com/Bhupesh-V/ugit/commits?author=Theotime812" title="Code">💻</a> <a href="https://github.com/Bhupesh-V/ugit/issues?q=author%3ATheotime812" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dr41d45"><img src="https://avatars.githubusercontent.com/u/47773787?v=4?s=100" width="100px;" alt="dr41d45"/><br /><sub><b>dr41d45</b></sub></a><br /><a href="https://github.com/Bhupesh-V/ugit/commits?author=dr41d45" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/T-Joseph-Kim"><img src="https://avatars.githubusercontent.com/u/116681578?v=4?s=100" width="100px;" alt="Taebok Joseph Kim"/><br /><sub><b>Taebok Joseph Kim</b></sub></a><br /><a href="https://github.com/Bhupesh-V/ugit/commits?author=T-Joseph-Kim" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/luxxmr"><img src="https://avatars.githubusercontent.com/u/185298948?v=4?s=100" width="100px;" alt="luxxmr"/><br /><sub><b>luxxmr</b></sub></a><br /><a href="https://github.com/Bhupesh-V/ugit/commits?author=luxxmr" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

19
ugit
View file

@ -7,7 +7,7 @@ set -uo pipefail;
SCRIPT_NAME="$0"
SCRIPT_URL="https://github.com/Bhupesh-V/ugit/releases/latest/download/ugit"
TMP_FILE="/tmp/ugit.sh"
VERSION="5.8"
VERSION="5.9"
pointer=""
BOLD_ORG_FG=$(tput bold)$(tput setaf 208)
@ -246,12 +246,21 @@ recover_deleted_tag() {
undo_file_delete() {
if [[ "$1" = "uncommited" ]]; then
# user didn't commit the file deletion
DELETED_FILE=$(git ls-files -d | fzf --ansi --height 20% --reverse --header="Choose deleted file to recover" | awk '{print $1}')
if git checkout HEAD "$DELETED_FILE"; then
printf "%s\n" "${BOLD}$DELETED_FILE${RESET} Successfully Recovered 👍️"
readarray -t DELETED_FILES < <(
git ls-files -d |
fzf --ansi --height 20% --reverse --header="Choose deleted files to recover" --multi |
awk '{print $1}'
)
if [ ${#DELETED_FILES[@]} -eq 0 ]; then
exit 0
fi
if git checkout HEAD -- "${DELETED_FILES[@]}"; then
printf "%s\n" "${BOLD}${DELETED_FILES[*]}${RESET}"
printf "%s\n" "Successfully Recovered ${#DELETED_FILES[@]} file(s)"
else
perror "Unable to recover ${BOLD}$DELETED_FILE${RESET}"
perror "Unable to recover ${BOLD}${DELETED_FILES[*]}${RESET}"
fi
elif [[ "$1" = "commited" ]]; then
read -p "Enter complete filename: " -r FILENAME