Skip to content

Instantly share code, notes, and snippets.

@ayaz-ac
ayaz-ac / main.sh
Created March 30, 2022 16:50
Bash function to checkout and update dependencies in a Rails project
cob() {
git checkout $1
git fetch origin
update_js="$(git diff --name-only origin/$1 package.json)"
update_sql="$(git diff --name-only origin/$1 db/structure.sql)"
update_gem="$(git diff --name-only origin/$1 Gemfile)"
git pull