Skip to content

Instantly share code, notes, and snippets.

View rsmoke's full-sized avatar
🏠
Working from home

rsmokeUM rsmoke

🏠
Working from home
View GitHub Profile
@rsmoke
rsmoke / gist:035921edddc138ec42f28857f6b0bbc0
Created April 15, 2020 21:07 — forked from jtdp/gist:5443297
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..

Setup

Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.

gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

Using PRY

@rsmoke
rsmoke / Git-Squash-Implementation.md
Created May 6, 2019 17:45 — forked from hlecuanda/Git-Squash-Implementation.md
Git Squash alias, from amazingly clean explanation on stackoverflow

From This other answer on the same thread

Based on Chris Johnsen's answer:

I added this line to the [alias] section of my git config file (~/.gitconfig):

squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"