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)