Git commonly used commands and basic concepts

1. Basic concepts
1.1Workspace workspace
          in the computer to see the directory.
1.2Index / Stage staging area (add)
          generally stored in "git directory" of the index file (.git / index) in, so the staging area is sometimes called an index (index).
1.3 repository
          workspace there is a hidden directory .git, this is not the work area, but git repository.
1.4Repository warehouse district or local warehouse (the commit)
1.5Remote remote repository (the Push)
2. commonly used commands
2.1git intit
          initialize a new warehouse.
2.2git clone <remote repository address>
          for cloning from an existing warehouse, the item data on the local server clones.
2.3git add <name>
          Adds the specified file.
     git add.
          Add all modified files.
          Workspace modify or add content files are written to the repository in a new object, and the object id is recorded in a temporary area of the file index.
2.4git commit -m 'The Submission Instructions'
          tree staging area will be written to the repository, master branch will make the appropriate updates, that master points to the latest directory tree is the time of submission of the original staging area tree.
2.5git status
          View the current state of the repository.
2.6git push origin <local branch name>
          local repository push to the remote repository.
2.7git fetch origin <remote branch name>
          get the latest version from remote to local, does not automatically merge (merge).
2.8git pull origin <remote branch name>
          to obtain from the remote (fetch) the latest version and merge (merge) to local, equivalent to fetch and then merge.
2.9git diff (staging area and working area)
     git diff the HEAD (the difference between the branches of the latest commit workspace current)
2.10git log
          display records submitted recently to the farthest from.
3. resolve conflicts
          in general after the merge, there will be conflict, the need to resolve the conflict for conflict situations, manually. The main reason is because the two users modify the same area of the same file.
Git commonly used commands and basic concepts

Guess you like

Origin blog.51cto.com/13678728/2426882