Skip to content
sbellity edited this page Jan 2, 2013 · 4 revisions

Branching

Branching will help you create your own copy of Aura to edit and commit to.

Create a fork

Login to github and go to https://github.com/aurajs/aura and press Fork.

Hardcore forking action

Add your remote:

git remote add <yourusername> [email protected]:<yourusername>/aura.git

Add the upstream / main repository:

git remote add upstream git://github.com/aurajs/aura.git

Get the latest commits:

git fetch upstream

Create a branch:

git checkout -b <yourbranch>

Do your changes

Push your branch to your github:

git push <yourusername> <yourbranch>

Continue to iterate through commit and pushing to your remote. When ready, create a pull request.

rebasing

git fetch upstream master Get up to date with the latest upstream repository commits.

git rebase upstream/master

See squashing below.

Meshing your commits into one diff

Depending on the context of your changes, it may be asked to squash your commits into one. This will turn your branches' changes into a single diff to be merged. When in doubt, keep your branches' commits as-is and see if a maintainer requests a squash to keep the git history clean.

git log to find the latest hash

git rebase -i <hash> where <hash> is the most distant place in history you want to squash against (normally it will just be a couple, 1-5 of your own commits in your branch).

See squashing below.

squashing

This will open an editor. You can pick a single commit and change the others you wish to squash.

After saving, git will check for any conflicts that need to be fixed by hand.

git status will show uncommitted files which must be fixed. Normally this is going to be between >>>. Fix the code to where it should be at present. Save it. git add <file> to add it to the rebase. git rebase --continue.

When this process is done, you may push it to your branch / PR.

git push --force <yourusername> <yourbranch>

if in detached head state, git push --force <yourusername> HEAD:<yourbranch>.

More stuff

See an example example rebase scenario.