Skip to content


Subversion checkout URL

You can clone with
Download ZIP


winton edited this page · 1 revision
Clone this wiki locally



sudo gem install capistrano


curl -O
tar xzf git*
cd git*
make configure
./configure —prefix=/usr/local
make all
sudo make install

Git tips

Add a submodule

git submodule add GIT_URL vendor/plugins/PLUGIN_NAME

Commit all changes

git commit -a

Vim opens. Type i, edit your commit message and type [esc] :x [enter]

You may also include your message using -m "Commit message"

Append local modifications to last commit

git commit -a —amend

Do not do this if you pushed your last commit.

Edit your commit history

git rebase -i HEAD~10

Remove commits by deleting lines.

Reorder commits by reordering lines.

Replace pick with edit to mark a commit for amending.

Replace pick with squash to merge a commit with the previous one.

If you marked a commit for editing

git commit —amend


git rebase —continue

Push commits to your GitHub repository

git push

Pull updates from your GitHub repository

git pull origin master

Pull updates from the rails-skeleton repository

git pull

Unfortunately, merge conflicts are inevitable.

For each conflict where you want to keep your version (example: deploy.rb):

git checkout config/deploy.rb

Stash your recent changes and revert to last commit

git stash

Reapply your stashed changes

git stash apply

Revert changes without saving

git reset —hard

Remove all untracked files (except ignored)

git clean -f -d

Removes across all branches, so watch out.

Export repository to zip

git archive —format=zip —prefix=my_repository/ HEAD >

Create branch and begin working in it

git checkout -b my_branch

Move back to your master branch

git checkout master

You can substitute master with a previous revision’s hash.

Merge the current branch with my_branch

git merge my_branch

Something went wrong with that request. Please try again.