Use git essays under Mac

Source: Internet
Author: User

SVN that was used all along. Recently work needs to use Git to manage the project, so a little bit of groping, some instructions to record, the right to leave a note.

The first thing to do is to sign up for a GitHub account and test the command.

———————————— githubConfiguration StartUnder Mac configuration use git to check if Git is installedgit-versionIf you want to use GitHub, you need to configure SshkeyCD ~Back to the User directory CD. SSH into SSH directory (if not, new. Already exist to do backup work. ) Ssh-keygen-t rsa-c Githubusernamegithubusername is my github account, generating a key pair id_rsa, id_rsa.pubPut id_rsa.pub的内容填在github的setting里Test if you can connect to GitHubssh-t [email protected]———————————— githubConfiguration Complete———————————— New Project and associate STARTmkdir GIT/HELLOWORDCD git/hellowordls-ahgit initls-ahtouch newfilelsgit Add NewFilegit commit-m ' first commit 'If you do not configure your account password you need to configuregit config-global user.name YourNamegit config-global user.email [email protected]The local repository is already set up and needs to be built on GitHub to create an empty https://github.com/githubusername/hellomacgit.git need to be remotely and locally associated with Git remote add origin [email Protected]:githubusername/hellomacgit.gitgit push-u Origin Master does not have a problem, this time the code has been uploaded.———————————— New Project and associate END———————————— Checkout a project from a remote repository to a localSTARTgit clone https://github.com/githubusername/hellomacgit.git after cloning into the project directory, where is the git system realmCDHellomacgit View all remote branches git branch-a switch to Branch1git checkout branch1or create a local branch, and remotely maintain a consistent git checkout-b branch1 origin/branch1 such as: Git checkout-b nextversion-wj origin/nextversion-wj after switching branches, To the directory to modify the code. Balabala git add-agit commit-m ' submit description 'git push Origin branch1Finally commit to the branch to go ———————————— Checkout a project from a remote repository to a localENDin this way, after the heart to add.

Use git essays under Mac

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.