New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better shortcuts #139

Merged
merged 11 commits into from Dec 30, 2014

Conversation

Projects
None yet
2 participants
@fasterthanlime
Contributor

fasterthanlime commented Dec 30, 2014

Cf. discussion in #138.

For reference, here's how you can integrate someone else's changes from a fork:

1. Add the remote

I usually name them from the github username of the person with the fork:

git remote add fasterthanlime https://github.com/fasterthanlime/cats.git

2. Fetch the new commits

The easy way:

git fetch --all

Then you can see in your branch list that you've got fasterthanlime/better-shortcuts

git branch --list --all

Or, you can be more precise:

git fetch fasterthanlime better-shortcuts

3. Cherry-pick or merge

If you're only interested in a commit or two, you can cherry-pick them

git log fasterthanlime/better-shortcuts

Would give you a list of all commits with authors, dates, messages, and most importantly commit hashes (SHA1).

Then you can run cherry-pick with any commit hash, and this will attempt to apply it to your current HEAD:

git cherry-pick e380b83857eb587ebecdf48587511b16d4e644b2

If you're happy with the state of a distant branch and just want to merge it all, you can check out the changes to a local branch, then switch back to your working branch, and merge it all:

this'll check out fasterthanlime/better-shortcuts to a local 'better-shortcuts' branch

git checkout --branch better-shortcuts

switch back to our working branch

git checkout unstable

merge it! :shipit:

git merge better-shortcuts

Some people prefer to use rebase over merge, but I always run into problems with rebase — I never quite mastered the art of using it properly (ie. it seems to be trying to reapply past commits and I end up with empty diffs.. eh, git's a mistery sometimes.)

The git merge command should be deceptively fast, almost as if it didn't do any work, but a quick git log will reassure you on the fact that the commits are, in fact, in your history now (along with a merge commit). Then all you have to do is push.

Or, since I made a pull request for that one, you can just click "Merge" on the GitHub UI and hopefully everything will go smoothly :)

jbaron added a commit that referenced this pull request Dec 30, 2014

@jbaron jbaron merged commit e1af86c into jbaron:unstable Dec 30, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment