Switch to the branch from which you created the pull request:
$ git checkout pull-request-branch
Overwrite the modified file(s) with the file in another branch, let's consider it's master:
git checkout origin/master -- src/package-lock.json
Switch to the branch from which you created the pull request:
$ git checkout pull-request-branch
Overwrite the modified file(s) with the file in another branch, let's consider it's master:
git checkout origin/master -- src/package-lock.json
function pr_notify() { | |
url=$(echo $(gh pr view | sed '10!d' | sed 's/.*://')) | |
title=$(echo $(gh pr view | sed '1!d' | sed 's/.*://')) | |
state=$(echo $(gh pr view | sed '2!d' | sed 's/.*://')) | |
author=$(echo $(gh pr view | sed '3!d' | sed 's/.*://')) | |
data=$(echo '{ | |
"cards": [ | |
{ | |
"header": { | |
"title": "🤖 Code Review", |
function pr(){ | |
repo="${PWD##*/}" | |
branch_name=$(git symbolic-ref -q HEAD) | |
task=$(echo $branch_name | awk -F/ '{print $NF}') | |
message=$(echo $(git log -n 1 --pretty=format:%B)) | |
gh pr create --title "$message" --body "## $message [$task](https://<your-org>.atlassian.net/browse/$task)" | |
} |
function BinarySearch(array, number) {
var minIndex = 0
var maxIndex = array.length - 1
while (minIndex <= maxIndex) {
var midIndex = Math.floor((maxIndex + minIndex) / 2)
osascript -e 'tell application "Spotify" to artist of current track & " - " & name of current track' |
function cssHandles(...arguments) {
return arguments.reduce((acc, cur) => {
if (typeof cur === 'string') return acc + ` ${cur}`;
if (typeof cur === 'object') {
return Object.keys(cur).map((key) => {
if(cur[key]) return acc + ` ${key}`
return acc
}).filter(Boolean).join('').trim()
function copy(value) { | |
setTimeout(async()=>console.log( | |
await window.navigator.clipboard.writeText(value)), 3000); | |
console.log("Color: " + value); | |
} | |
window.colorPicker = () => new EyeDropper().open().then((color)=> copy(color.sRGBHex)) | |
window.colorPicker(); | |
// create color picker snippet |
# terminal utils | |
alias pkg="cat package.json" | |
alias head-pkg="head package.json" | |
alias tail-pkg="tail package.json" | |
alias pkg-scripts="pkg | jq .scripts" | |
alias hgrep="history | grep " |
for d in ./*/ ; do (cd "$d" && echo "${PWD##*/}" && ls ; [ -f manifest.json ] && vtex link); done |