Skip to content

Instantly share code, notes, and snippets.

@ivangodfather
Created August 15, 2014 22:29
Show Gist options
  • Select an option

  • Save ivangodfather/072d7d994c840435e8bd to your computer and use it in GitHub Desktop.

Select an option

Save ivangodfather/072d7d994c840435e8bd to your computer and use it in GitHub Desktop.
[~/desktop/test] $ echo "hi" > file
[~/desktop/test] $ git init
Reinitialized existing Git repository in /Users/ivanruizmonjo/Desktop/test/.git/
[~/desktop/test] $ git add file
[~/desktop/test] $ git commit -am "Initial commit"
[master (root-commit) bd5201b] Initial commit
1 file changed, 1 insertion(+)
create mode 100644 file
[~/desktop/test] git:master $ git branch -a
* master
[~/desktop/test] git:master $ git checkout -b newBranch
Switched to a new branch 'newBranch'
[~/desktop/test] git:newBranch $ echo "modified by newBranch" > file
[~/desktop/test] git:newBranch $ git checkout master
M file
Switched to branch 'master'
[~/desktop/test] git:master $ cat file
modified by newBranch
[~/desktop/test] git:master $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment