1
0
mirror of https://github.com/k88hudson/git-flight-rules.git synced 2025-06-16 12:54:01 -03:00

64 Commits

Author SHA1 Message Date
f9b72fe495 Added firstaidgit.io
Closes #54.
2015-05-20 00:47:29 +07:00
efb1619f25 Merge pull request #64 from unixorn/master
Add "Other Resources" section
2015-05-20 00:45:32 +07:00
64182bca50 Add Other resources section
* Add link to git-workflow - closes #59
* Add link to git-extra-commands collection of helper scripts
* Add link to source tree
2015-05-19 10:40:24 -07:00
a9b0361a88 Strip trailing spaces 2015-05-19 10:40:03 -07:00
264d3dde33 Merge pull request #61 from RichardLitt/feature/deleted-fork
Added a section about deleted PRs
2015-05-20 00:19:46 +07:00
1b4cad1552 Added a section about deleted PRs 2015-05-19 14:23:25 +07:00
aeaa38e922 Merge pull request #60 from RichardLitt/feature/arialdomartini
`git reset --hard master~1` rather than `git reset --hard a13b85e`
2015-05-19 14:15:27 +07:00
b0c20c4804 Added explanation of HEAD, kept past example 2015-05-19 14:13:19 +07:00
6a23217314 Using git reset --hard HEAD^, as suggested by @konrado0905 2015-05-19 14:11:34 +07:00
e4fe866e14 Merge pull request #56 from RichardLitt/force-push-rebase
Rebasing and force pushing
2015-05-16 01:37:47 +07:00
d673566e0d Rebasing and force pushing 2015-05-15 13:24:00 +07:00
08bbf9a967 Merge pull request #58 from RichardLitt/master
Merge stuartpb-patch-2
2015-05-15 13:21:03 +07:00
a32ec5590e Merge branch 'stuartpb-patch-2' 2015-05-15 13:20:02 +07:00
1a993cec3e Added text, moved to appropriate section 2015-05-15 13:19:52 +07:00
5a0f04c8e9 Merge branch 'patch-2' of https://github.com/stuartpb/git-flight-rules into stuartpb-patch-2 2015-05-15 13:14:04 +07:00
8c4e12be63 Merge pull request #57 from RichardLitt/feature/commits-to-old-branch
Added two sections for moving unstaged edits
2015-05-14 05:31:22 +07:00
9f1fbc5861 Added two sections for moving unstaged edits
I often want to add commits to a new branch, and to an old branch that is empty, but I forget how. Here it is.
2015-05-11 14:00:59 +07:00
0f7027159a Merge pull request #55 from RichardLitt/master
Merge
2015-04-26 18:19:47 +08:00
8c5b442718 Merge branch 'stuartpb-patch-1' 2015-04-26 18:19:00 +08:00
bec92700e4 Merge 2015-04-26 18:18:50 +08:00
2ebceca748 Merge pull request #53 from unixorn/master
Minor typo fix, remove trailing spaces
2015-04-21 14:31:46 +07:00
ab17fbc6ab Minor typo fix, remove trailing spaces 2015-04-20 23:39:46 -07:00
597bde6d7b Merge pull request #52 from RichardLitt/master
Merged in the Delete PR
2015-03-23 11:17:34 +08:00
caf8d3c8b4 Made a deleting category 2015-03-23 11:15:55 +08:00
08ced44cd3 Merge branch 'patch-1' of https://github.com/dandv/git-flight-rules into dandv-patch-1
# Conflicts:
#	README.md
2015-03-23 11:13:54 +08:00
2bf72a4ec4 Merge pull request #51 from RichardLitt/master
RM tips
2015-03-21 10:16:18 +08:00
46aff394db Merge branch 'jm-tips' of https://github.com/xinsight/git-flight-rules into xinsight-jm-tips 2015-03-21 10:13:04 +08:00
0fe348620e Merge pull request #50 from RichardLitt/master
Removed second force-push section
2015-03-20 20:42:15 +08:00
d718c438ee Removed second force-push section
This commit was in #18, first.
2015-03-20 20:39:57 +08:00
17dea4c558 Merge pull request #49 from RichardLitt/master
Doctoc fixes. :|
2015-03-16 13:18:55 -07:00
974505558f Doctoc fixes. :| 2015-03-16 13:18:19 -07:00
6f9d0f8797 Merge pull request #48 from RichardLitt/gitter-badger-gitter-badge
Gitter
2015-03-16 13:15:04 -07:00
fed9948810 Merge branch 'gitter-badge' of https://github.com/gitter-badger/git-flight-rules into gitter-badger-gitter-badge 2015-03-16 13:14:01 -07:00
a9bfc9f52a Merge pull request #47 from RichardLitt/master
PR Feedback
2015-03-16 13:10:29 -07:00
d5d405fbbf Merge branch 'camwes-patch-1' 2015-03-16 13:09:56 -07:00
c108121f94 Doctoc 2015-03-16 13:09:41 -07:00
fc5d15e54c Merge branch 'patch-1' of https://github.com/camwes/git-flight-rules into camwes-patch-1 2015-03-16 13:09:15 -07:00
88252b2d91 PR feedback 2015-03-16 12:15:05 -07:00
b1016fbeb9 Merge pull request #46 from RichardLitt/master
Merge Josh dutcher
2015-03-16 10:21:17 -07:00
0ecf651254 Doctoc, closes #35 2015-03-16 10:20:18 -07:00
a52d5152d8 Merge branch 'joshdutcher-master' 2015-03-16 10:20:05 -07:00
5b0a37cfdd Merge branch 'master' of https://github.com/joshdutcher/git-flight-rules into joshdutcher-master
# Conflicts:
#	README.md
2015-03-16 10:19:49 -07:00
ea87639b03 added 'pulled from/into the wrong branch' 2015-03-16 12:11:41 -05:00
0e64bc4cb5 Merge pull request #45 from RichardLitt/master
Moved doctoc
2015-03-16 09:33:56 -07:00
49c3e94217 Moved doctoc 2015-03-16 09:33:13 -07:00
80854f6e60 Alignment
We're going to have to keep tabs on this, doesn't seem perfect.
2015-03-16 09:22:16 -07:00
50bf10c986 Merge pull request #44 from RichardLitt/master
Moved header
2015-03-16 09:21:27 -07:00
c8e0049af6 Moved header 2015-03-16 09:20:51 -07:00
108aa058f0 Merge pull request #38 from RichardLitt/toc
Added TOC using npm module doctoc
2015-03-16 09:19:25 -07:00
5b6dfb05c9 Added TOC using npm module doctoc
This should automatically update. All it takes on the maintainer's end
is to `npm install -g doctoc`, and run it once in the file. I like
the look of it, and I think this solves the issue in one command nicely.
This is made to deal with #10.
2015-03-16 09:18:49 -07:00
92211c458f Added Gitter badge 2015-03-14 18:51:22 +00:00
19c8ad3ab9 Added then
This makes it clear that `git rebase` is not a check to see if master is up to date. #3
2015-03-14 11:06:23 -07:00
a2d407f12e Merge pull request #42 from RichardLitt/git-commit-wrong-branch-33
Added note about git push
2015-03-14 10:26:29 -07:00
34e4f3e39b Added note about git push
This reflects that your origin will be out of sync with remote if you reset. Just a small note. I noticed this when testing #33
2015-03-14 10:25:34 -07:00
660a9b59ca Merge pull request #28 from unixorn/add-missing-anchor-tag
Add missing anchor tag
2015-03-13 18:01:23 -04:00
7ad2b8db96 Merge remote-tracking branch 'upstream/master' into add-missing-anchor-tag 2015-03-13 14:03:03 -07:00
1ddfc1707d Merge pull request #41 from k88hudson/circosta
fixes typo
2015-03-13 15:00:18 -04:00
0a2f618d0f Add a few recipes 2014-11-30 17:21:34 -08:00
a4a708b9df Add missing anchor tag 2014-08-22 14:08:27 -07:00
a53267fd27 Add "I need to undo my last commit" 2014-08-14 12:01:43 -07:00
abb085de05 Add "Oh crap, what did I just commit" 2014-08-14 11:46:47 -07:00
9f20e13e41 fix prompt to match style guide 2014-07-31 23:21:46 -04:00
36b4aadc11 add 4 tips 2014-07-31 23:16:43 -04:00
978e484967 Update README.md 2014-07-29 11:53:00 -07:00

366
README.md
View File

@ -1,7 +1,6 @@
# Flight rules for git
### What are "flight rules"?
#### What are "flight rules"?
A [guide for astronauts](http://www.jsc.nasa.gov/news/columbia/fr_generic.pdf) (now, programmers using git) about what to do when things go wrong.
@ -11,17 +10,57 @@ A [guide for astronauts](http://www.jsc.nasa.gov/news/columbia/fr_generic.pdf) (
— Chris Hadfield, *An Astronaut's Guide to Life*.
#### Conventions for this document
### Conventions for this document
For clarity's sake all examples in this document use a customized bash prompt in order to indicate the current branch and whether or not there are staged changes. The branch is enclosed in parentheses, and a `*` next to the branch name indicates staged changes.
For clarity's sake all examples in this document use customized bash prompt in order to indicate the current branch and whether or not there are staged changes. The branch is enclosed in parentheses, and a `*` next to the branch name indicates staged changes.
[![Join the chat at https://gitter.im/k88hudson/git-flight-rules](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/k88hudson/git-flight-rules?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [I wrote the wrong thing in a commit message](#i-wrote-the-wrong-thing-in-a-commit-message)
- [I need to add staged changes to the previous commit](#i-need-to-add-staged-changes-to-the-previous-commit)
- [I tried to push my amended commit to a remote, but I got an error message](#i-tried-to-push-my-amended-commit-to-a-remote-but-i-got-an-error-message)
- [I rebased, but I don't want to force push.](#i-rebased-but-i-dont-want-to-force-push)
- [I need to combine commits](#i-need-to-combine-commits)
- [Possible issues with merging](#possible-issues-with-merging)
- [Safe merging strategy:](#safe-merging-strategy)
- [I need to merge a branch into a single commit](#i-need-to-merge-a-branch-into-a-single-commit)
- [I want to combine only unpushed commits](#i-want-to-combine-only-unpushed-commits)
- [Possible issues with interactive rebases](#possible-issues-with-interactive-rebases)
- [The rebase editing screen says 'noop'](#the-rebase-editing-screen-says-noop)
- [There were conflicts](#there-were-conflicts)
- [I committed with the wrong name and email configured](#i-committed-with-the-wrong-name-and-email-configured)
- [I committed to master instead of a new branch](#i-committed-to-master-instead-of-a-new-branch)
- [I made several commits on a single branch that should be on different branches](#i-made-several-commits-on-a-single-branch-that-should-be-on-different-branches)
- [I want to add aliases for some git commands](#i-want-to-add-aliases-for-some-git-commands)
- [I pulled from/into the wrong branch](#i-pulled-frominto-the-wrong-branch)
- [I want to discard local commits so my branch is the same as one on the server](#i-want-to-discard-local-commits-so-my-branch-is-the-same-as-one-on-the-server)
- [I want to discard my local, uncommitted changes](#i-want-to-discard-my-local-uncommitted-changes)
- [I want to move my unstaged edits to a new branch](#i-want-to-move-my-unstaged-edits-to-a-new-branch)
- [I want to move my unstaged edits to a different, existing branch](#i-want-to-move-my-unstaged-edits-to-a-different-existing-branch)
- [What did I just do?](#what-did-i-just-do)
- [I want to add changes in one file to two different commits](#i-want-to-add-changes-in-one-file-to-two-different-commits)
- [I want to remove a file from git but keep the file](#i-want-to-remove-a-file-from-git-but-keep-the-file)
- [Clone all submodules](#clone-all-submodules)
- [Deleting Objects](#deleting-objects)
- [I want to delete local branches that were deleted upstream](#i-want-to-delete-local-branches-that-were-deleted-upstream)
- [I accidentally deleted my branch](#i-accidentally-deleted-my-branch)
- [Delete/remove last pushed commit](#deleteremove-last-pushed-commit)
- [Delete/remove last local commit](#deleteremove-last-local-commit)
- [Delete/remove arbitrary commit](#deleteremove-arbitrary-commit)
- [Delete tag](#delete-tag)
- [Deleted Patch](#deleted-patch)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<a name="amend"></a>
## I wrote the wrong thing in a commit message
```sh
git commit --amend
```
```
## I need to add staged changes to the previous commit
@ -33,16 +72,44 @@ git commit --amend
<a name="force-push"></a>
### I tried to push my amended commit to a remote, but I got an error message
```sh
To https://github.com/yourusername/repo.git
! [rejected] mybranch -> mybranch (non-fast-forward)
error: failed to push some refs to 'https://github.com/tanay1337/webmaker.org.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```
Note that, as with rebasing (see below), amending **replaces the old commit with a new one**, so you must force push (`-f`) your changes if you have already pushed the pre-amended commit to your remote. Be careful when you do this &ndash; *always* make sure you specify a branch!
In general, **avoid force pushing**. It is best to create and push a new commit rather than force-pushing the amended commit as it has will cause conflicts in the source history for any other developer who has interacted with the branch in question or any child branches.
```sh
(mybranch) $ git push origin mybranch -f
```
In general, **avoid force pushing**. It is best to create and push a new commit rather than force-pushing the amended commit as it has will cause conflicts in the source history for any other developer who has interacted with the branch in question or any child branches.
<a name="force-push-rebase"></a>
### I rebased, but I don't want to force push.
Unfortunately, you have to force push, if you want those changes to be reflected on the remote branch. This is because you have fast forwarded your commit, and changed git history. The remote branch won't accept changes unless you force push. This is one of the main reasons many people use a merge workflow, instead of a rebasing workflow - large teams can get into trouble with developers force pushing. Use this with caution. A safer way to use rebase is not to reflect your changes on the remote branch at all, and instead to do the following:
```sh
git checkout branch
git rebase -i master
git checkout master
git merge --ff-only branch
```
For more, see [this SO thread](http://stackoverflow.com/questions/11058312/how-can-i-use-git-rebase-without-requiring-a-forced-push).
<a name="interactive-rebase"></a>
## I need to combine commits
You need to do something called an interactive rebase.
If you are working in a branch that is/will become a pull-request against `master`, you can rebase against your `master` branch. Make sure it is up to date:
If you are working in a branch that is/will become a pull-request against `master`, you can rebase against your `master` branch. Make sure the master branch is up to date, then:
```
(my-branch)$ git rebase -i master
@ -119,6 +186,17 @@ If everything is successful, you should see something like this:
```
(master)$ Successfully rebased and updated refs/heads/master.
```
### Possible issues with merging
#### Safe merging strategy:
`--no-commit` performs the merge but pretends the merge failed and does not autocommit, giving the user a chance to inspect and further tweak the merge result before committing. `no-ff` maintains evidence that a feature branch once existed, keeping project history consistent.
```sh
(master)$ git merge --no-ff --no-commit featurebranch
```
#### I need to merge a branch into a single commit
```sh
(master)$ git merge --squash featurebranch
```
<a name="rebase-unpushed-commits"></a>
#### I want to combine only unpushed commits
@ -167,16 +245,20 @@ Changes not staged for commit:
In this example, `README.md` has conflicts. Open that file and look for the following:
```
<<<<<<< HEAD
some code
=========
some code
>>>>>>> new-commit
<<<<<<< HEAD
some code
=========
some code
>>>>>>> new-commit
```
You will need to resolve the differences between the code that was added in your new commit (in the example, everything from the middle line to `new-commit`) and your `HEAD`.
Sometimes these merges are complicated and you should use a visual diff editor:
```sh
(master*)$ git mergetool -t opendiff
```
After you have resolved all conflicts and tested your code, `git add` the files you have changed, and then continue the rebase with `git rebase --continue`
```
@ -189,32 +271,13 @@ If at any time you want to stop the entire rebase and go back to the original st
(my-branch)$ git rebase --abort
```
<a name="force-push"></a>
#### When I try to push, I get an error message:
```
To https://github.com/yourusername/repo.git
! [rejected] mybranch -> mybranch (non-fast-forward)
error: failed to push some refs to 'https://github.com/tanay1337/webmaker.org.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```
Since rebasing **replaces the old commit(s) with a new one**, you must force push (`-f`) your changes. Be careful when you do this &ndash; *always* make sure you specify a branch!
```
(mybranch) $ git push origin mybranch -f
```
<a name="commit-wrong-author"></a>
## I committed with the wrong name and email configured
If it's a single commit, amend it
```
$ git commit --amend --author "New Authorname <authoremail@mydomain.com>"
$ git commit --amend --author "New Authorname <authoremail@mydomain.com>"
```
If you need to change all of history, see the man page for 'git filter-branch'
@ -226,21 +289,31 @@ If you need to change all of history, see the man page for 'git filter-branch'
Create the new branch while remaining on master:
```
(master)$ git branch new-branch
(master)$ git checkout -b new-branch
(new-branch)$ git checkout master
(master)$
```
Find out what the commit hash you want to set your master branch to (`git log` should do the trick). Then reset to that hash.
Reset the branch master to the previous commit:
```sh
(master)$ git reset --hard HEAD^
```
`HEAD^` is short for `HEAD^1`. You can reset further through the generations by specifying which `HEAD` to set to.
Alternatively, if you don't want to use `HEAD^`, find out what the commit hash you want to set your master branch to (`git log` should do the trick). Then reset to that hash. `git push` will make sure that this change is reflected on your remote.
For example, if the hash of the commit that your master branch is supposed to be at is `a13b85e`:
```
```sh
(master)$ git reset --hard a13b85e
HEAD is now at a13b85e
```
Checkout the new branch to continue working:
```
```sh
(master)$ git checkout new-branch
```
@ -310,15 +383,153 @@ And finally, let's cherry-pick the commit for bug #14:
(14)$ git cherry-pick 5ea5173
```
<a name="adding-command-aliases"></a>
## I want to add aliases for some git commands
On OS X and Linux, your git configuration file is stored in ```~/.gitconfig```. I've added some example aliases I use as shortcuts (and some of my common typos) in the ```[aliases]``` section as shown below:
```
[aliases]
a = add
amend = --amend
c = commit
ca = commit --amend
ci = commit -a
co = checkout
d = diff
dc = diff --changed
ds = diff --staged
f = fetch
loll = log --graph --decorate --pretty=oneline --abbrev-commit
m = merge
one = log --pretty=oneline
outstanding = rebase -i @{u}
s = status
unpushed = log @{u}
wc = whatchanged
wip = rebase -i @{u}
zap = fetch -p
```
<a name="pull-wrong-branch"></a>
## I pulled from/into the wrong branch
This is another chance to use `git reflog` to see where your HEAD pointed before the bad pull.
```
(master)$ git reflog
ab7555f HEAD@{0}: pull origin wrong-branch: Fast-forward
c5bc55a HEAD@{1}: checkout: checkout message goes here
```
Simply reset your branch back to the desired commit:
```
git reset --hard c5bc55a
```
Done.
<a href="discard-local-commits"></a>
## I want to discard local commits so my branch is the same as one on the server
Confirm that you haven't pushed your changes to the server.
`git status` should show how many commits you are ahead of origin:
```sh
(bug24)$ git status
# On branch bug24
# Your branch is ahead of 'origin/bug24' by 2 commits.
# (use "git push" to publish your local commits)
#
```
One way of reseting to match origin (to have the same as what is on the remote) is to do this:
```sh
(master)$ git reset --hard origin/bug24
```
If you want to only reset to some commit between origin and your local, you can do this:
```sh
# one commit
(bug24)$ git reset --hard HEAD^
# two commits
(bug24)$ git reset --hard HEAD^^
# four commits
(bug24)$ git reset --hard HEAD~4
```
<a href="discard-local-uncommited-changes"></a>
## I want to discard my local, uncommitted changes
```sh
(master)$ git reset --hard
# or
(master)$ git checkout -f
```
<a href="move-unstaged-edits-to-new-branch"></a>
## I want to move my unstaged edits to a new branch
```sh
$ git checkout -b new-branch
```
<a href="move-unstaged-edits-to-old-branch"></a>
## I want to move my unstaged edits to a different, existing branch
```sh
$ git stash
$ git checkout branch2
$ git stash pop
```
<a name="diff-last"></a>
## What did I just do?
Let's say that you just blindly committed changes with `git commit -a` and you're not sure what the actual content of the commit you just made was. You can check the difference between your current HEAD and what your HEAD just was with:
```
(master)$ git diff HEAD@{1} HEAD
```
<a href="stage-in-two-commits"></a>
## I want to add changes in one file to two different commits
`git add` will add the entire file to a commit. `git add -p` will allow to interactively select which changes you want to add.
<a href="remove-from-git"></a>
## I want to remove a file from git but keep the file
```sh
(master)$ git rm --cached log.txt
```
<a name="clone-submodules"></a>
## Clone all submodules
```sh
git clone --recursive git://github.com/foo/bar.git
# If already cloned:
git submodule update --init --recursive
```
<a name="deleting"></a>
## Deleting Objects
<a name="delete-stale-local-branches">
## I want to delete local branches that were deleted upstream
### I want to delete local branches that were deleted upstream
Once you merge a pull request on github, it gives you the option to delete the merged branch in your fork. If you aren't planning to keep working on the branch, it's cleaner to delete the local copies of the branch so you don't end up cluttering up your working checkout with a lot of stale branches.
```bash
$ git fetch -p
```
## I accidentally deleted my branch
<a name='restore-a-deleted-branch'>
### I accidentally deleted my branch
If you're regularly pushing to remote, you should be safe most of the time. But still sometimes you may end up deleting your branches. Let's say we create a branch and create a new file:
@ -387,30 +598,61 @@ README.md foo.txt
Voila! We got our removed file back. Git reflog is also useful when rebasing goes terribly wrong.
<a name="adding-command-aliases"></a>
## I want to add aliases for some git commands
<a name="delete-pushed-commit"></a>
### Delete/remove last pushed commit
On OS X and Linux, your git configuration file is stored in ```~/.gitconfig```. I've added some example aliases I use as shortcuts (and some of my common typos) in the ```[aliases]``` section as shown below:
If you need to delete pushed commits, you can use the following. However, it will irreversabily change your history, and mess up the history of anyone else who had already pulled from the repository. In short, if you're not sure, you should never do this, ever.
```sh
git reset HEAD^ --hard
git push -f [remote] [branch]
```
<a name="undo-commit"></a>
### Delete/remove last local commit
If you haven't pushed, to reset Git to the state it was in before you made your last commit (while keeping your staged changes):
```
[aliases]
a = add
amend = --amend
c = commit
ca = commit --amend
ci = commit -a
co = checkout
d = diff
dc = diff --changed
ds = diff --staged
f = fetch
loll = log --graph --decorate --pretty=oneline --abbrev-commit
m = merge
one = log --pretty=oneline
outstanding = rebase -i @{u}
s = status
unpushed = log @{u}
wc = whatchanged
wip = rebase -i @{u}
zap = fetch -p
(my-branch*)$ git reset --soft HEAD@{1}
```
This only works if you haven't pushed. If you have pushed, the only truly safe thing to do is `git revert SHAofBadCommit`. That will create a new commit that undoes all the previous commit's changes. Or, if the branched you pushed to is rebase-safe (ie. other devs aren't expected to pull from it), you can just use `git push -f`. For more, see [the above section](#deleteremove-last-pushed-commit).
<a name="delete-any-commit"></a>
### Delete/remove arbitrary commit
The same warning applies as above. Never do this if possible.
```sh
git rebase --onto SHA1_OF_BAD_COMMIT^ SHA1_OF_BAD_COMMIT
git push -f [remote] [branch]
```
<a name="delete-tag"></a>
### Delete tag
```sh
git tag -d <tag_name>
git push <remote> :refs/tags/<tag_name>
```
<a name="deleted-patch"></a>
## Deleted Patch
If someone has sent you a pull request on GitHub, but then deleted their original fork, you will be unable to clone their commits or to use `git am`. In such cases, it is best to manually look at their commits and copy them into a new branch on your local. Then, commit.
After commiting, change the author of the previous commit. To do this, see how to [change author](#commit-wrong-author). Then, apply whatever changes needed on to, and make a new pull request.
# Other resources
## Tutorials
* [git-workflow](https://github.com/asmeurer/git-workflow) - [Aaron Meurer](https://github.com/asmeurer)'s howto on using git to contribute to open source repositories
## Scripts & Tools
* [firstaidgit.io](http://firstaidgit.io/) A searchable selection of the most frequently asked Git questions
* [git-extra-commands](https://github.com/unixorn/git-extra-commands) - a collection of useful extra git scripts
* [Source Tree](https://www.sourcetreeapp.com/) - a free graphical git client for Windows and OS X