GIT-version controller (local repository)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.