Create a warehouse locally and then manage it. Submit to the local repository (no network required), submit to the remote repository (requires network) in the same way that SVN is cloned, the entire repository is assigned, and SVN is just a copy of the code. 1. The computer creates a "local warehouse" empty folder 2. Open Terminal: Enter the CD space and then directly drag the desktop empty folder into the Enter and enter GIT init return3. Create a new Xcode project that resides in the local repositories folder4. Terminal input user name: Git config user.name lanou02 return and enter email: git config user.email[email protected]Enter 5. Look at the config file 6. Set the global username and mailbox Terminal input name: git config--global user.name lanou002 Enter the mailbox: Git config--global user.email[email protected]Enter view 7. Terminal View Status: Input git status green: Submitted red: Uncommitted Workspace-Staging area-Warehouse re-enter: Git Add. Enter (add: Here is the command behavior when adding an entire file when you want to commit a file: Git add commits the filename) git commi T-am "Add Project" there will be a lot of things to enter the Git status return to commit, the working directory clean, The description is up to date 8. The project has been created and can be developed open engineering try adding a print statement to the Viewcontroller Terminal View status: Enter git status return to see the red code added to the warehouse: Enter git Add. (here or throughout the commit) add the changelog: Enter git commit-am "add 1111" and enter Git status return to see the latest version 9. View Log rollback version (return) terminal input: Git log return version number 40-bit hash terminal input: Git re Flog enter 9-1. The rollback version has been submitted to rollback to the previous version of terminal input: Git reset--hard head^ returns after the print statement that you just added in Viewcontroller disappears, indicating that the previous version has been rolled back to the specified version of the terminal input: git Reset--hard 54c1df0 Returns the print statement that you just added in Viewcontroller, stating that you have returned to the specified version of the relevant website: Related additions:
GIT-version controller (local repository)