git basics

304 views

Published on

git is a distributed revision control and source code management (SCM) system with an emphasis on speed.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
304
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

git basics

  1. 1. git
  2. 2. remote repository or remote https://github.com/SpongeUK/git-sandbox.githttps://github.com/SpongeUK/git-sandbox.git README.md
  3. 3. git clone https://github.com/SpongeUK/git-sandbox.gitgit clone https://github.com/SpongeUK/git-sandbox.git README.md git clone README.md remotelocal
  4. 4. README.mdREADME.md remotelocal HEAD README.md The last committed version is called the HEAD git tracks your changes da39a3e
  5. 5. README.mdREADME.md remotelocal HEAD README.md git addgit add index.htmlgit add index.html index.html da39a3e
  6. 6. README.mdREADME.md remotelocal HEAD git commitgit commit -m “first page”git commit -m “first page” index.html README.md index.html a5c6870 da39a3e
  7. 7. README.mdREADME.md remotelocal HEAD index.html README.md index.html a5c6870 da39a3e Edits are tracked too...
  8. 8. README.mdREADME.md remotelocal HEAD index.html README.md index.html a5c6870 da39a3e git checkoutgit checkout -- README.mdgit checkout -- README.md checkout will get a specific file from the HEAD, its like an undo
  9. 9. README.md remotelocal HEAD git pushgit pushgit push index.html index.html a5c6870 da39a3e index.html push sends all of your commits to GitHUB README.md index.html README.md index.html
  10. 10. Do some work... git add .git add . git commit -m “stuff”git commit -m “stuff” git pushgit push The usual workflow is to edit, add, commit and then push when you ready...
  11. 11. git add .git add . git commit -m “stuff”git commit -m “stuff” git pushgit push ...that way you can always go back to a previous commit.Do some work...
  12. 12. git can merge two commits even if they were made by different people on different computers in the same file git mergegit merge
  13. 13. git can maintain parallel branchesso you can experiment with changes and leave the original unchanged git branchgit branch
  14. 14. for more information... http://git-scm.com/

×