Skip to content

Instantly share code, notes, and snippets.

View ajaykumar97's full-sized avatar
:octocat:
Committing from home

Ajay Kumar ajaykumar97

:octocat:
Committing from home
View GitHub Profile
@Powell-v2
Powell-v2 / post_merge_deps_update.sh
Last active March 1, 2024 13:18
Install any missing deps after merging in updates from remote.
# capture info messages and any errors in a log file
exec >> log/hooks-out.log 2>&1
if git diff-tree --name-only --no-commit-id ORIG_HEAD HEAD | grep -q 'package.json'; then
echo "$(date): reinstalling deps since package.json changed"
yarn > /dev/null
else
echo "$(date): no changes detected in package.json"
fi
@EQuimper
EQuimper / clear.txt
Created June 16, 2017 16:17
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 26, 2024 10:54
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@betorobson
betorobson / post-checkout
Last active January 10, 2022 13:13 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` and `git checkout` if a specified file was change for example, package.json or bower.json
#!/usr/bin/env bash
# fork from https://gist.github.com/jakemhiller/d342ad51505addf78ec628a16fd3280f
changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
check_run package.json "npm prune && npm install"
@magnusbae
magnusbae / git-stop-tracking-remote-branch.md
Created April 8, 2014 20:05
How to make Git stop track a remote branch without deleting the remote branch.

You don't have to delete your local branch.

Simply delete your remote tracking branch:

git branch -d -r origin/<remote branch name> (This will not delete the branch on the remote repo!)

See "Having a hard time understanding git-fetch"

there's no such concept of local tracking branches, only remote tracking branches.

@sindresorhus
sindresorhus / post-merge
Last active February 14, 2024 06:20
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"