1
Git-svn for Beginners Cheat Sheet by EzequielMuns (ezk) via cheatography.com/2595/cs/799/ Setting up a git svn working copy Checkout standard repository git svn clone -s svn-url local-dir Reflect & track remote ignores git svn show-ignore > .gitignore Reflect remote ignores git svn show-ignore >> .git/info/exclude Normal git workflow Add file/stage changes (recursive) git add file Remove file git rm [-r] file Interactively stage changes git add -i Revert unstaged changes git checkout file Revert staged changes git reset HEAD file Commit staged changes git commit Add and commit all changes git commit -a Working with branches Create new branch git branch new-branch [old-branch] Move to a branch git checkout branch Create and move to new branch git checkout -b new- branch [ old-branch] List local branches git branch List local and remote (svn) branches git branch -a Merging a branch to current branch git merge other-branch Merge a branch as single commit git merge --squash other-branch Updating from and committing to svn Apply remote changes to local repo git svn rebase Commit changes back to Subversion git svn dcommit By EzequielMuns (ezk) cheatography.com/ezk/ Published 22nd January, 2013. Last updated 28th February, 2013. Page 1 of 1. Sponsored by Readability-Score.com Measure your website readability! https://readability-score.com

Ezk Git Svn for Beginners

Embed Size (px)

DESCRIPTION

git cheatsheet useful commands

Citation preview

Page 1: Ezk Git Svn for Beginners

Git-svn for Beginners Cheat Sheetby EzequielMuns (ezk) via cheatography.com/2595/cs/799/

Setting up a git svn working copy

Checkout standard

repository

git svn clone -s svn-url

local -dir

Reflect & track

remote ignores

git svn show-i gnore >

.gitignore

Reflect remote

ignores

git svn show-i gnore >>

.git/i nfo /ex clude

Normal git workflow

Add file/stage changes

(recur sive)

git add file

Remove file git rm [-r] file

Intera ctively stage changes git add -i

Revert unstaged changes git checkout file

Revert staged changes git reset HEAD

file

Commit staged changes git commit

Add and commit all changes git commit -a

Working with branches

Create new branch git branch new-b ranch[old- bra nch]

Move to a branch git checkout branch

Create and move to

new branch

git checkout -b new-

b ranch [old- bra nch]

List local branches git branch

List local and remote

(svn) branches

git branch -a

Merging a branch to

current branch

git merge other -br anch

Merge a branch as

single commit

git merge --squash

other -br anch

Updating from and committing to svn

Apply remote changes to local

repo

git svn

rebase

Commit changes back to

Subversion

git svn

dcommit

By EzequielMuns (ezk)

cheatography.com/ezk/

Published 22nd January, 2013.

Last updated 28th February, 2013.

Page 1 of 1.

Sponsored by Readability-Score.com

Measure your website readability!

https://readability-score.com