github learning summary

1. Install git (download the git installer)

2. After the installation is complete, you need to enter your user name and email
address $git config --global user.name "your name"
$git config --global user.mail "eamil@example. com "

3. Create a repository

First select a place and create an empty directory
$mkdir learngit
$cd learngit
$pwd

4. Turn this directory into a manageable repository through the git init command

$git init
There will be an additional .git directory in the current directory. If you do not see the .git directory, you
can use the ls-ah command
or ls-al to view all files

5. Establish a connection between the local and the remote warehouse in order to push the file

$git remote add origin git@____

6. Add files to git repository

(1) Use the command git add <file> to be used repeatedly and add multiple files
(2) Use the command git commit -m "" to complete
(3) Use the command git push warehouse name branch name

If we start from zero, we The best way is:
(1) Log in to GitHub to create a new repository
(2) Clone a local repository with the command git clone
$git clone git@______ address (remote address)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325083804&siteId=291194637