chiefwigms / picobrew_pico

MIT License
149 stars 63 forks source link

Added hook/script to run after git updates #266

Closed cgalpin closed 3 years ago

cgalpin commented 3 years ago

This will cover the current need to update existing installations with bluetooth disabled, and a place to add additional checks in the future.

It will run on reboot if/when update_boot is true, as well as when the server is updated via the UI when on a raspberry pi.

tmack8001 commented 3 years ago

71 commits

@cgalpin future make sure your reset your master or desire branch against the upstream/master (which should be set to this repo)

cgalpin commented 3 years ago

I have been! I still don't know why it says that, but at least it only reflects the current changes. Here is what I did

git remote remove upstream
git remote add upstream https://github.com/chiefwigms/picobrew_pico.git
git reset --hard upstream/master

It still shows we ahead after that.

chiefwigms commented 3 years ago

typically you'd merge whatever branch in to your branch, then push.. try: git stash (if you have changes git checkout master git pull git checkout <branch> git merge master git stash pop (if you have changes) git commit git push

cgalpin commented 3 years ago

I dunno what to say. believe me, this is driving me nuts

pi@raspberrypi:~ $ cd picobrew_pico/
pi@raspberrypi:~/picobrew_pico $ git checkout master
Already on 'master'
pi@raspberrypi:~/picobrew_pico $ git pull
From https://github.com/cgalpin/picobrew_pico
   1d9c871..c30cf23  master     -> picobrew_pico/master
Already up to date.
pi@raspberrypi:~/picobrew_pico $ git merge master
Already up to date.
pi@raspberrypi:~/picobrew_pico $ git checkout test
pi@raspberrypi:~/picobrew_pico $ git merge master
Already up to date.
pi@raspberrypi:~/picobrew_pico $ git commit
On branch master
Your branch is up to date with 'picobrew_pico/master'.

Untracked files:
        bluetooth_notes.txt

nothing added to commit but untracked files present
pi@raspberrypi:~/picobrew_pico $ git push
Everything up-to-date
pi@raspberrypi:~/picobrew_pico $ 
tmack8001 commented 3 years ago

This is all I ever do before starting a dev branch:

git checkout masterr
git fetch upstream
git reset --hard upstream/master
git checkout -b $(whoami)/<feature-branch>
tmack8001 commented 3 years ago

yeah @cgalpin that git pull you are doing is "pulling origin" which is your forked repository and not the upstream (that is the language I use).

git remote -v
origin  git@github.com:tmack8001/picobrew_pico.git (fetch)
origin  git@github.com:tmack8001/picobrew_pico.git (push)
upstream    git@github.com:chiefwigms/picobrew_pico.git (fetch)
upstream    git@github.com:chiefwigms/picobrew_pico.git (push)

origin == my fork repo upstream == OSS repo

tmack8001 commented 3 years ago

I have been! I still don't know why it says that, but at least it only reflects the current changes. Here is what I did

git remote remove upstream
git remote add upstream https://github.com/chiefwigms/picobrew_pico.git
git reset --hard upstream/master

It still shows we ahead after that.

yes that will reset reference to upstream/master, but you never preformed a fetch or pull on that upstream so is always just referencing the local .git metadata files that you have (remember git is a distributed version control system meaning you have a full or shallow copy/clone of the remote distributed version control data).

cgalpin commented 3 years ago

Ok, i think i got myself reset (at the expense of losing my changes), but fortunately i still had my IDE up and could recover them

See https://github.com/chiefwigms/picobrew_pico/pull/268

tmack8001 commented 3 years ago

image

cgalpin commented 3 years ago

Exactly. I swear I'm not a complete idiot all the time, but I do play on on the internet.