Compare commits
No commits in common. "93108710e461f2ab8183f319580cfc7153e2a38c" and "c892680974b4cd76f2d523464b3f3106f63900b7" have entirely different histories.
93108710e4
...
c892680974
@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
sh ~/.local/bin/git-worktree-setup.sh "$@"
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
url=$1
|
|
||||||
basename=${url##*/}
|
|
||||||
name=${2:-${basename%.*}}
|
|
||||||
|
|
||||||
mkdir -p "$name"
|
|
||||||
cd "$name"
|
|
||||||
|
|
||||||
git clone --bare "$url" .bare
|
|
||||||
echo "gitdir: ./.bare" > .git
|
|
||||||
|
|
||||||
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
|
|
||||||
git fetch origin
|
|
||||||
|
|
||||||
default_branch=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
|
|
||||||
git worktree add "$default_branch"
|
|
||||||
|
|
||||||
osascript -e "tell application \"Terminal\" to do script \"cd '$PWD/$default_branch' && clear\" in front window"
|
|
||||||
30
.zshrc
30
.zshrc
@ -133,36 +133,6 @@ alias rm=trash
|
|||||||
|
|
||||||
alias gst="git status"
|
alias gst="git status"
|
||||||
alias gwt="git worktree"
|
alias gwt="git worktree"
|
||||||
|
|
||||||
do_cd_worktree() {
|
|
||||||
# Must be in a git repo
|
|
||||||
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
||||||
echo "Not in a git repository"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get worktree root (handles being in subdirectory of worktree)
|
|
||||||
local wt_root=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
||||||
local project_root=$(dirname "$wt_root")
|
|
||||||
|
|
||||||
# If we're in the bare repo root, project_root is parent
|
|
||||||
if [[ -d "$wt_root/.bare" ]]; then
|
|
||||||
project_root="$wt_root"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get worktree directories (exclude bare repo)
|
|
||||||
local selected=$(git worktree list --porcelain | \
|
|
||||||
grep '^worktree ' | \
|
|
||||||
cut -d' ' -f2- | \
|
|
||||||
grep -v '\.bare$' | \
|
|
||||||
xargs -I{} basename {} | \
|
|
||||||
fzf --height 10% --color=light,hl:196,hl+:196)
|
|
||||||
|
|
||||||
if [[ -n "$selected" ]]; then
|
|
||||||
cd "${project_root}/${selected}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
alias wt="do_cd_worktree"
|
|
||||||
alias gdf="gdifftool"
|
alias gdf="gdifftool"
|
||||||
alias fuck="init_thefuck"
|
alias fuck="init_thefuck"
|
||||||
alias nvm="fnm"
|
alias nvm="fnm"
|
||||||
|
|||||||
@ -8,8 +8,7 @@
|
|||||||
"editor.fontWeight": "normal",
|
"editor.fontWeight": "normal",
|
||||||
"window.titleBarStyle": "native",
|
"window.titleBarStyle": "native",
|
||||||
"window.commandCenter": false,
|
"window.commandCenter": false,
|
||||||
"window.nativeTabs": false,
|
"window.nativeTabs": true,
|
||||||
"workbench.editor.showTabs": "single",
|
|
||||||
"workbench.editor.showIcons": false,
|
"workbench.editor.showIcons": false,
|
||||||
"workbench.layoutControl.enabled": false,
|
"workbench.layoutControl.enabled": false,
|
||||||
"workbench.colorTheme": "MacOS Modern Light - Ventura Xcode Default",
|
"workbench.colorTheme": "MacOS Modern Light - Ventura Xcode Default",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user