Created by Luis Ibanez / @luisibanez
git clone git@github.com:ossp/Git-Branchy-Story-Exercise-02.git
cd Branchy-Story-Exercise-02
git remote -v
Courtesy of git-scm Book.
Courtesy of git-scm Book.
git remote add luisgithub git@github.com:luisibanez/Git-Branchy-Story-Exercise-02.git
git remote -v
Work with your Team
For the address of your team mates
mkdir FantasticFour
cd FantasticFour
nano README.md
cd ..
git add FantasticFour
git commit -m "Started team directory"
git push origin master
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:ossp/Git-Branchy-Story-Exercise-01.git'
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.
git pull origin master
git push origin master
git pull origin master
git log
The log tells you:
git log --oneline
Every commit
is identified by a hash
such as:
5d7d137a3592fe402a4bc282375c2d8bb878326c
git show 5d7d137
git show 5d7d137
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:ossp/Git-Branchy-Story-Exercise-01.git'
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.
git pull origin master
git push origin master
git branch MyNewBranch
git checkout MyNewBranch
vim myCharacter.md
git add myCharacter.md
git commit
git checkout master
git pull origin master
git merge --no-ff MyNewBranch
git push origin master
git log --no-merges .
git log --no-merges myCharacter.md
git log --no-merges myCharacter.md --oneline
git log --graph
gitk