Git is the fastest, simplest, and most popular open source Distributed version Control tool, the author of which is the father of Linux: Linus Benedict Torvalds
1. Configure Git in the terminal
Open terminal, CD to git target workspace
GIT init//Create a local git workspace
git config user.name "Pjxwang"//user Name
git config user.email "* * @qq. com"//mailbox
git status//view git workspace file status
git add filename//Add file to git admin
git commit-m "identity"//Submit
git config alias.st "status"//for status to alias to St
git config alias.cm "commit-m"
git log//view git logs information, current version
git reflog//View all versions
Fallback
git reset--hard HEAD//force fallback to current version
git reset--hard head^//force fallback to previous version
git reset--hard head^^//forced fallback to previous two versions
git reset--hard head~100//forced fallback to previous 100 versions
git reset--hard [top seven of the version]//force fallback to version with the specified version number
Global configuration file. gitconfig
git config--global user.name "Pjxwang"//user Name
git config--global user.email "* * @qq. com"//mailbox
GIT init--bare//Create code Repository
git clone directory//Clone code library to local
2.git without gap docking with Xcode
When creating a project, check git management at the same time
Update the code warehouse with Xcode
General execution Order: first commit to local, not tick Push->pull->push
Team development, there may be version conflicts at the time of submission, Xcode offers four solutions. Note: After resolving the conflict, re-commit and push
Create the. Gitignore into the project directory, and. Git in the same folder, from GitHub to find the Objective-c gitignore code copy we created ourselves. Gitignore
Xcode view git log:command +option +shift+return
Code Hosting server platform: https://git.oschina.net
Git related info: http://www.cocoachina.com/ios/20140524/8536.html
The use of Git