Upgrade to Pro — share decks privately, control downloads, hide ads and more …

沒有 GUI 的 git

沒有 GUI 的 git

Avatar for 蔡佳緯

蔡佳緯

March 17, 2016

Other Decks in Programming

Transcript

  1. # ¡M log ¦ì¾ git 㱺 git config --global user.name

    weitsai # ¡M±Ý-Aà git 㱺 git config --global user.email [email protected]
  2. 
 â´¥ 
 git ޝ git | master 㱺 echo

    ‘test’ >> test.md 
 hJޝ test
  3. 
 â´¥ 
 git ޝ git | master⚡ 㱺 git

    commit -m ‘Update’ test 
 hJޝ
  4. git | master 㱺 git cat-file -t 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 blob git

    | master 㱺 git cat-file -p 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 test
  5. 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
  6. git | master 㱺 git cat-file -p 9098a4 100644 blob

    9098a46b8a3cb674c82833688dfb5c77995053c2 test.md git | master 㱺 git cat-file -t 9098a4 tree
  7. # F uÉiÑÛk git | master 㱺 git remote add

    origin {repo_url} # å¼ uÉiÑÛk git | master 㱺 git remote rm origin # ›uÉiÑÛk git | master 㱺 git remote -v
  8. # F uÉiÑÛk git | master 㱺 git push origin

    master # ›uÉiÑÛk git | master 㱺 git pull origin master # ›uÉiÑÛk git | master 㱺 git clone {repo_url}
  9. #  commit Q#7Ë¯ git | master 㱺 git commit

    -v # ŒÏ—FçÑ git | master 㱺 git add -p # ftRK· git | master 㱺 git checkout -f
  10. # › commit ˯ git | master 㱺 git log

    # º™·l{ git | master 㱺 git log -p # dž×.... git | master 㱺 git blame
  11. # ª©!š git | master 㱺 git checkout -b test

    # ®$H%É!š git | test 㱺 git branch # ®$L!š íÓ remote repo) git | test 㱺 git branch -a # L!š"1 commit git | test 㱺 git branch -vv
  12. # @K commit Н git | master 㱺 git reset

    HEAD~1 # @K? commit Н git | master 㱺 git reset HEAD^^ # ~¦ @æ commit çÑ git | master 㱺 git reset —hard
  13. # ^³; commit git | master 㱺 git revert HEAD~1

    # &³ !š:mëíʨî git | master 㱺 git merge —no-f q[branch] # ' commit ˯:· git | master 㱺 git rebase -i [commit]
  14. git | master 㱺 echo ‘  GUI  GIT’

    > README.md git | master⚡ 㱺 git add README.md git | master⚡ 㱺 git commit -m ‘Add README’
  15. 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’
  16. 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)’
  17. 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)’
  18. 

  19. 

  20. • ­j&l{tE • ­je 50 –n • ­j*O•–Á • ­j

    P€ • ­j¬g‚-#Z˜–aí dê–î • l{E" 72 –n • l{¬g|Ü5 :ïc:ï
  21. # OS X git | master 㱺 git config --global

    core.autocrlf input # Windows git | master 㱺 git config --global core.autocrlf true
  22. # å¼á8W¢¸ git 㱺 git filter-branch --force --index-filter \ 'git

    rm --cached --ignore-unmatch *.md' \ --prune-empty --tag-name-filter cat -- --all
  23. SVN

  24. # ^Už SVN iÑ svn 㱺 git svn clone -r

    HEAD {Repo URL} # °`·Æ#[Dy SVN Server git | master⚡ 㱺 git svn rebase # N²—ŠV Server  git | master⚡ 㱺 git svn dcommit