GIT Create local reposition (creating a native repository)

Source: Internet
Author: User

1. Create a warehouse named Git-reposition

mkdir home/sunjf/git-reposition

Note: HOME/SUNJF can be specified as the path you want below

2. Initialize the Warehouse

CD ~/git-reposition//Enter the warehouse directory

GIT init//Initialize Repository

At this point, the. git file will be generated in the repository, as the hidden file needs to be viewed through Ls-ah

  

3. Build the Readme.txt file in the warehouse and add the content

Touch Readme.txt//Create Readme.txt Text

sudo vim readme.txt//Edit text content, can enter information casually, this step is optional, I lose the content for "my git-reposition test!"

4. Check the warehouse status

git status//view warehouse status, prompting for non-tracked files

    

5. Add Tracking

git add readme.txt//Add trace for Readme.txt

At this point, execute the git status command, prompting Readme.txt for the new file

   

6, submit Readme.txt to the local warehouse

Git commit-m "Add Readme.txt"//-m to add a description command

At this point, execute the git status command, as follows

  

7. Submit to the remote repository (I am here for the new test2 on GitHub and can refer to git remote repository create)

Ssh-keygen-t rsa-c "[email protected]"//Generate Git public key

Add it to GitHub after it is generated

  Git remote add origin Https://github.com/shaoyesun/test2.git//local warehouse associated with remote repository

  Git push-u origin master//Add local repository content to remote repository

   

At this point, you can see in GitHub

  

  

GIT Create local reposition (creating a native 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.