Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ➜ ~>mkdir gittest
- ➜ ~>cd gittest
- ➜ gittest>git init
- Initialized empty Git repository in /home/andres/gittest/.git/
- ➜ gittest git:(master)>nano file.txt
- ➜ gittest git:(master) ✗>ls
- file.txt
- ➜ gittest git:(master) ✗>nano code.py
- ➜ gittest git:(master) ✗>ls
- code.py file.txt
- ➜ gittest git:(master) ✗>git status
- On branch master
- Initial commit
- Untracked files:
- (use "git add <file>..." to include in what will be committed)
- code.py
- file.txt
- nothing added to commit but untracked files present (use "git add" to track)
- ➜ gittest git:(master) ✗>git add file.txt code.py
- ➜ gittest git:(master) ✗>git status
- On branch master
- Initial commit
- Changes to be committed:
- (use "git rm --cached <file>..." to unstage)
- new file: code.py
- new file: file.txt
- ➜ gittest git:(master) ✗>
- git commit -m "Added two simple files"
- [master (root-commit) ddd1e9e] Added two simple files
- 2 files changed, 6 insertions(+)
- create mode 100644 code.py
- create mode 100644 file.txt
- ➜ gittest git:(master)>ls
- code.py file.txt
- ➜ gittest git:(master)>git status
- On branch master
- nothing to commit, working directory clean
- ➜ gittest git:(master)>git log
- commit ddd1e9e91b047448ccf4e62ff2a891d1d7133cf7
- Author: Andres Cabrera <mantaraya36@gmail.com>
- Date: Tue May 26 10:29:22 2015 -0700
- Added two simple files
- ➜ gittest git:(master)>nano code.py
- ➜ gittest git:(master) ✗>git status
- 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: code.py
- no changes added to commit (use "git add" and/or "git commit -a")
- ➜ gittest git:(master) ✗>git add code.py
- ➜ gittest git:(master) ✗>git status
- On branch master
- Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
- modified: code.py
- ➜ gittest git:(master) ✗>
- git commit -m "Code now asks for and prints user's name"
- [master 5d21265] Code now asks for and prints user's name
- 1 file changed, 2 insertions(+), 1 deletion(-)
- ➜ gittest git:(master)>git status
- On branch master
- nothing to commit, working directory clean
- ➜ gittest git:(master)>git log
- commit 5d212659635fea6fecaa85928d8b255202572901
- Author: Andres Cabrera <mantaraya36@gmail.com>
- Date: Tue May 26 10:33:39 2015 -0700
- Code now asks for and prints user's name
- commit ddd1e9e91b047448ccf4e62ff2a891d1d7133cf7
- Author: Andres Cabrera <mantaraya36@gmail.com>
- Date: Tue May 26 10:29:22 2015 -0700
- Added two simple files
- ➜ gittest git:(master)>nano code.py
- ➜ gittest git:(master) ✗>git status
- 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: code.py
- no changes added to commit (use "git add" and/or "git commit -a")
- ➜ gittest git:(master) ✗>git reset --hard HEAD
- HEAD is now at 5d21265 Code now asks for and prints user's name
- ➜ gittest git:(master)>git status
- On branch master
- nothing to commit, working directory clean
- ➜ gittest git:(master)>cat code.py
- name = raw_input("What's your name? ")
- print "Hello " + name
- ➜ gittest git:(master)>gitk
- ⏎ ➜ gittest git:(master)> git gui
- ➜ gittest git:(master)>nano code.py
- ➜ gittest git:(master) ✗>git gui
- ➜ gittest git:(master)>gitk
- ➜ gittest git:(master)>git branch second_person
- ➜ gittest git:(master)>git status
- On branch master
- nothing to commit, working directory clean
- ➜ gittest git:(master)>gitk
- ➜ gittest git:(master)>git checkout second_person
- Switched to branch 'second_person'
- ➜ gittest git:(second_person)>gitk
- ➜ gittest git:(second_person)>nano code.py
- ➜ gittest git:(second_person) ✗>git gui
- ➜ gittest git:(second_person)>gitk
- ➜ gittest git:(second_person)>git checkout master
- Switched to branch 'master'
- ➜ gittest git:(master)>nano
- code.py file.txt
- ➜ gittest git:(master)>nano file.txt
- ➜ gittest git:(master) ✗>git gui
- ➜ gittest git:(master)>gitk
- ➜ gittest git:(master)>man gitk
- ➜ gittest git:(master)>gitk -all
- ➜ gittest git:(master)>gitk --all
- ➜ gittest git:(master)>git checkout second_person
- Switched to branch 'second_person'
- ➜ gittest git:(second_person)>cd
- ➜ ~>cd gittest/
- ➜ gittest git:(second_person)>git merge master
- Merge made by the 'recursive' strategy.
- file.txt | 2 ++
- 1 file changed, 2 insertions(+)
- ➜ gittest git:(second_person)>gitk
- ➜ gittest git:(second_person)>nano file.txt
- ➜ gittest git:(second_person) ✗>git gui
- ➜ gittest git:(second_person)>gitk
- ➜ gittest git:(second_person)>git master
- git: 'master' is not a git command. See 'git --help'.
- ➜ gittest git:(second_person)>git checkout master
- Switched to branch 'master'
- ➜ gittest git:(master)>git merge second_person
- Updating 5a3a51c..5be6d7f
- Fast-forward
- code.py | 3 +++
- file.txt | 2 +-
- 2 files changed, 4 insertions(+), 1 deletion(-)
- ➜ gittest git:(master)>gitk
- ➜ gittest git:(master)>git branch -d second_person
- Deleted branch second_person (was 5be6d7f).
- ➜ gittest git:(master)>gitk
- ➜ gittest git:(master)>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement