Git installation has been connected to github1. install git [plain] sudoapt-getinstallgit-coregit-guigit-doc2. set sshkey. git connects to github by backing up the original key [plain] cd ~ through ssh (an encrypted file similar to the ftp transfer protocol ~ /. Ssh... git installation has been connected to github 1. install git [plain] sudo apt-get install git-core git-gui git-doc 2. set the ssh key. git connects to github through ssh (an encrypted file similar to the ftp transfer protocol) to back up the original key [plain] cd ~ /. Ssh // enter. ssh Directory (hidden directory ls-lh view) $ ls // list. all files in the ssh directory $ mkdir key_backup // create a directory for backup $ cp id_rsa * key_backup // Copy. ssh directory original key to backup directory $ rm id_rsa * // delete original key create new ssh key [plain] $ ssh-keygen-t rsa-C "your_email@youremail.com" execute this command will prompt the file storage path, press Enter and then prompt to Enter passphrase (password). Enter twice (you can Enter twice without entering) and then Enter in. the ssh directory produces two files: id_rsa and id_rsa.pub 3. add an ssh key to github On the GitHub site Click "Account Settings"> Cl Ick "SSH Keys"> Click "Add SSH key" and Click the wrench icon in the upper right corner. Then, Click the ssh key in the left-side menu, then, use kate or another text editor to open the id_rsa.puh file on the right side of the page and copy all the characters in the file. (do not use vi here. if you copy a key using vi, an invalid key is displayed, this is probably a line feed problem.) paste the copied key to the github key. The title can be left blank. Click "add key" to display the "invalid key prompt (in English)". if passphrase is entered earlier, a prompt is displayed. 4. test the ssh link github [plain] $ ssh-T git@github.com // enter it like this and don't change the prompt that successfully will be OK. 5. set your own git information [plain] $ git config -- global user. name "Firstname Lastname" Sets the name of the user for all git instances on the system $ git config -- global user. email "your_email@youremail.com" 6. git usage // assume that the existing project directory submits cd dirname to the project directory git init git to initialize git add. there is a ". "add the current directory git commit-m" commit first time "to submit locally // The mkdir projectName project that starts from 0 to create the folder cd projectName and enter the folder git init git initialization touch README to create the README file git add README file git commit-m "commit file README" submit 7. on the github homepage, click "new repository" at Your Repositories and enter the name and description. select "private" or "public" to create a repository (repository) enter the repository to view the code, newwork, wiki, and other menus. There are three links under the menu: ssh, http, and git only, copy ssh address [plain] $ git remote add origin git@github.com: username/Hello-World.gitSets the origin for the Hello-World repo // enter the address you just copied here $ git push-u origin master
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