Key Concepts in Git:
- Working directory (working directory): Modify the file in the working directory, the modified file status is modified, the newly added file is untracked, save the file to staging area through the git add command;
- Staging Area: Save the next snapshot that will be submitted to a file in Git repository. The file status is staged, and the git commit command submits the file to the Git repository;
- Git repository: local repository. Update the remote server repository with the git push command and update the local repository with the git pull command.
Start using git:
- Install git,http://progit.org/book/on this machine
- Use GitHub to act as a remote server, hosting local code: www.github.com
- Register your account on GitHub and create a warehouse where you can host your local repository.
- The rest is to learn from the principle of git, familiar with the common GIT commands, do not understand Git--help.
Common git commands:
- git config: Configure git
- git add: Update files in working directory to staging area. git Add. Update All Files
- Git commit: Submit files in staging area to Git repository. git commit-m ' message '
- Git Status: View status
- git diff: See how things are changing
- Git remote: View the remote server alias, plus-v Display URL information
- git remote add server_url local-alias: Add remote server
- git clone project_url local_alias: Copy Project to native
- git push server_url/local-alias: Update the remote server repository
- Git pull server_url/local-alias: Update the local server repository
GitHub Learning Experience