KEMBAR78
沒有 GUI 的 Git | PDF
GUI Git
1.
2.
3.
4.
@afu
https://www.youtube.com/watch?v=_yQlKEq-Ueg
Repository
Developer
Developer Developer
Developer
Developer Developer
-
Repository
MainActivity.java
Developer
Repository
MainActivity.java
Developer
Repository
MainActivity.java
Developer
-
Repository
MainActivity.java
Developer
Repository
MainActivity.java
Repository
MainActivity.java
Developer Developer
Repository
MainActivity.java
Developer Developer
Develop Repository
Develop Develop
Develop Repository
Office Repository
Develop
Develop Repository
Fork
Develop Repository
Develop Develop
Develop Repository
Office Repository
Develop
Develop Repository
Commit
Develop Repository
Develop Develop
Develop Repository
Office Repository
Develop
Develop Repository
Pull Request
• ( )
•
• git
@oxxo
GUI or CLI?
http://www.slant.co/topics/465/compare/~the-command-line_vs_sourcetree_vs_tower-2
https://www.facebook.com/groups/git.tw/permalink/991589810889687/?qa_ref=qd
Git
http://www.slant.co/topics/153/compare/~github_vs_gitlab_vs_bitbucket
# log
git git config --global user.name weitsai
#
git git config --global user.email
begining1003@gmail.com
# Editor (vim, sublime or atom…)
git git config --global core.editor vim
Local

 
 

git
git git init

 

git
git | master⚡ touch test.md


test

 

git
git | master⚡ git add test.md
test



 

git
git | master⚡ git commit
test



 

git
git | master echo ‘test’ >> test.md


test

 

git
git | master⚡ git add test.md
test



 

git
git | master⚡ git commit -m ‘Update’
test


…
git | master echo ‘test’ >> test.md
git | master⚡ git add test.md
git | master git cat-file -t
9daeafb9864cf43055ae93beb0afd6c7d144bfa4
blob
git | master git cat-file -p
9daeafb9864cf43055ae93beb0afd6c7d144bfa4
test
git | master git commit -m ‘Add test file’
[master (root-commit) 77f64af] Add test file
1 file changed, 1 insertion(+)
create mode 100644 test.md
git | master git cat-file -t 77f64af
commit
git | master git cat-file -p 77f64af
git | master git cat-file -p 9098a4
100644
blob
9098a46b8a3cb674c82833688dfb5c77995053c2
test.md
git | master git cat-file -t 9098a4
tree
Commit
77f64af
Tree Blob
9daeaf 77f64af
Remote
#
git | master git remote add origin
{repo_url}
#
git | master git remote rm origin
#
git | master git remote -v
#
git | master git push origin master
#
git | master git pull origin master
#
git | master git clone {repo_url}
# commit
git | master git commit -v
#
git | master git add -p
#
git | master git checkout -f
# commit
git | master git log
#
git | master git log -p
# ....
git | master git blame
#
git | master git diff
#
git | master git checkout -b test
#
git | test git branch
# remote repo)
git | test git branch -a
# commit
git | test git branch -vv
# commit
git | master git reset HEAD~1
# commit
git | master git reset HEAD^^
# commit
git | master git reset —hard
# commit
git | master git revert HEAD~1
#
git | master git merge —no-f
q[branch]
# commit
git | master git rebase -i [commit]
#
git | master git merge —no-f
{branch_name}
Conflict
git | master echo ‘ GUI GIT’ >
README.md
git | master⚡ git add README.md
git | master⚡ git commit -m ‘Add
README’
git | master git checkout -b conflict
git | conflict echo ‘ GUI GIT’
> README.md
git | conflict ⚡ git add README.md
git | conflict ⚡ git commit -m
‘Update README’
git | conflict git checkout master
git | master echo ‘ GUI GIT’ >
README.md
git | master ⚡ git add README.md
git | master ⚡ git commit -m ‘Update
README(master)’
git | master git checkout conflict
git | conflict echo ‘ GUI GIT’
> README.md
git | conflict ⚡ git add README.md
git | conflict ⚡ git commit -m
‘Update README(conflict)’
git | conflict git rebase master
git | conflict vim README.md
https://www.flickr.com/photos/appleboy/5488984404
Master -
Develop -
Feature -
Release - develop bug
Hotfix - master bug
Commit
•
• 50
•
•
•
• 72
•
http://chris.beams.io/posts/git-commit/
SSH key
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Alias
CRLF
# OS X
git | master git config --global
core.autocrlf input
# Windows
git | master git config --global
core.autocrlf true
Tool
https://github.com/buunguyen/octotree
https://rtyley.github.io/bfg-repo-cleaner/
Security
gitignore
git javac test.java
git git status
http://gitignore.io/
https://github.com/github/gitignore
https://help.github.com/articles/remove-sensitive-data/
#
git git filter-branch --force --index-filter 
'git rm --cached --ignore-unmatch *.md' 
--prune-empty --tag-name-filter cat -- --all
SVN
# SVN
svn git svn clone -r HEAD {Repo URL}
# SVN Server
git | master⚡ git svn rebase
# Server
git | master⚡ git svn dcommit
• Git Book
• A successful Git branching model (Gitflow)
• iHower -
• How to Write a Git Commit Message
• Generating a new SSH key and adding it to the ssh-
agent
• What are the best hosted version control services?

沒有 GUI 的 Git