The use of Git

Source: Internet
Author: User

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

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.