Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Git tutorial


Published on

  • Be the first to comment

  • Be the first to like this

Git tutorial

  1. 1. Gitdistributed version control system Wei-Tsung Lin
  2. 2. Introduction● Git is a open source distributed version control system designed to handle everything from small to large projects with speed and efficiency.● Create a branch to test new features, commit many times, and roll back to where you branched from.● Have a master branch that contains only the content go to the production, another that you merge work for testing, and several tiny changes for nightly build.
  3. 3. Distributed● Git is a distributed system, which means that instead of doing "checkout" of source code every times, you can have your own clone of the entire repository.● You can work on the projects without Internet, and then commit your works after you get connection.● Only "add" action is implemented, so you can restore everything which has existed in your repository.
  4. 4. Enviroment● You can get Git from most package manager in Linux system.● Under Windows, you can use MSysGit.● git config --global "name"● git config --global "email"● git config --global apply.whitespace nowarn● git config --global color.ui true
  5. 5. Initialize● Create new repository Find a empty directory, and execute command: "git init", initialize empty Git repository in directory ".git".● Clone a repository Command: "git clone url"
  6. 6. Basic usagetouch README git add README git commit -m "README"unstage stage commit
  7. 7. Commit log● Console: git log● Windows: TortoiseGit● Linux: giggle● Mac: GitX
  8. 8. Branch● Commits are Identified by SHA.● Master means which branch we are working on.● "git checkout" to change branch
  9. 9. Example
  10. 10. Mergegit checkout mastergit merge issue1
  11. 11. Rebasegit checkout hotfixgit rebase master
  12. 12. Reference