Skip to content

Instantly share code, notes, and snippets.

@rentzsch
Created July 9, 2013 05:55
Show Gist options
  • Save rentzsch/5955019 to your computer and use it in GitHub Desktop.
Save rentzsch/5955019 to your computer and use it in GitHub Desktop.
Last login: Tue Jul 9 00:48:28 on ttys004
wolf-air1:~ wolf$ mkdir _gitspike2
wolf-air1:~ wolf$ cd _gitspike2
wolf-air1:_gitspike2 wolf$ date > dates.txt
wolf-air1:_gitspike2 wolf$ gti init
Initialized empty Git repository in /Users/wolf/_gitspike2/.git/
wolf-air1:_gitspike2 wolf$ git add .
wolf-air1:_gitspike2 wolf$ gti ci -m "initial commit"
[master (root-commit) 005ff52] initial commit
1 file changed, 1 insertion(+)
create mode 100644 dates.txt
wolf-air1:_gitspike2 wolf$ gti co -b dev
Switched to a new branch 'dev'
wolf-air1:_gitspike2 wolf$ date > dev.dates.txt
wolf-air1:_gitspike2 wolf$ git add dev.dates.txt
wolf-air1:_gitspike2 wolf$ gti ci -m "add dev.dates.txt"
[dev 998f98e] add dev.dates.txt
1 file changed, 1 insertion(+)
create mode 100644 dev.dates.txt
wolf-air1:_gitspike2 wolf$ gti co master
Switched to branch 'master'
wolf-air1:_gitspike2 wolf$ date >> dates.txt
wolf-air1:_gitspike2 wolf$ git ci -m "append dates.txt"
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dates.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
wolf-air1:_gitspike2 wolf$ git ci -am "append dates.txt"
[master 5941313] append dates.txt
1 file changed, 1 insertion(+)
wolf-air1:_gitspike2 wolf$ git co dev
Switched to branch 'dev'
wolf-air1:_gitspike2 wolf$ pwd
/Users/wolf/_gitspike2
wolf-air1:_gitspike2 wolf$ git remote add self file:///Users/wolf/_gitspike2
wolf-air1:_gitspike2 wolf$ git push self dev:master
To file:///Users/wolf/_gitspike2
! [rejected] dev -> master (non-fast-forward)
error: failed to push some refs to 'file:///Users/wolf/_gitspike2'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
wolf-air1:_gitspike2 wolf$ git rb
git: 'rb' is not a git command. See 'git --help'.
Did you mean this?
rm
wolf-air1:_gitspike2 wolf$ git b
* dev
master
wolf-air1:_gitspike2 wolf$ git st
# On branch dev
nothing to commit (working directory clean)
wolf-air1:_gitspike2 wolf$ git merge master
Merge made by the 'recursive' strategy.
dates.txt | 1 +
1 file changed, 1 insertion(+)
wolf-air1:_gitspike2 wolf$ git push self dev:master
Total 0 (delta 0), reused 0 (delta 0)
To file:///Users/wolf/_gitspike2
5941313..39d1c84 dev -> master
wolf-air1:_gitspike2 wolf$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment