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.
————————————
github
Configuration 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.pub
Put
id_rsa.pub的内容填在github的setting里
Test if you can connect to GitHubssh-t [email protected]————————————
github
Configuration 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