mirror of
https://github.com/Bhupesh-V/ugit.git
synced 2026-09-10 07:26:20 -04:00
Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38b7be7335 | ||
|
|
2b0936d813 | ||
|
|
fc4e473fa2 | ||
|
|
43c205e315 | ||
|
|
019646b1ed | ||
|
|
ab99ea6110 | ||
|
|
8f6e7218da |
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
18
README.md
18
README.md
|
|
@ -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>
|
||||
|
||||
[](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
19
ugit
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue