1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00

35 lines
716 B
Bash
Raw Normal View History

2022-03-26 21:18:10 +11:00
#!/bin/sh
set -e
cd $1
git init
git config user.email "CI@example.com"
git config user.name "CI"
# we're setting this to ensure that it's honoured by the fetch command
git config fetch.prune true
echo test1 > myfile1
git add .
git commit -am "myfile1"
git checkout -b other_branch
git checkout master
cd ..
2022-03-27 11:47:07 +11:00
git clone --bare ./repo origin
2022-03-26 21:18:10 +11:00
2022-03-27 11:47:07 +11:00
cd repo
2022-03-26 21:18:10 +11:00
2022-03-27 11:47:07 +11:00
git remote add origin ../origin
2022-03-26 21:18:10 +11:00
git fetch origin
git branch --set-upstream-to=origin/master master
git branch --set-upstream-to=origin/other_branch other_branch
# unbenownst to our test repo we're removing the branch on the remote, so upon
# fetching with prune: true we expect git to realise the remote branch is gone
2022-03-27 11:47:07 +11:00
git -C ../origin branch -d other_branch