Git shell command to upload code

Article source: http://www.itnose.net/detail/6249788.html

More articles: http://www.itnose.net

Create Repository steps:

1. Create a local folder

2. Enter the folder and execute

git init
After initialization, git will version control the files in this folder

3. Create a Repository on a remote server (such as github), note down SSH

4. Execute

git remote add <a name> <SSH>
You can use this name to submit code to the corresponding Repository in the future

5. Submit the code

 

 

The configuration of Git before creating the Repository:

git config --global user.name "your name"
git config --global user.email "your Email"
git config --global  push.default "simple"

Start creating the Repository:

mkdir folder name
the folder above the cd
git init
touch README
git add README
git commit -m 'description'
git remote add xxx <SSH>
git push -u xxx master



Upload code:

1. Drag the files you want to upload to Git into this folder

2. Execute the following commands in sequence:

git add .
git commit -m 'description'
git push -u xxx master

3. If no error is reported during the execution of the above command, then it should have been uploaded. If it is wrong, I don't know. . . .

 

Article source: http://www.itnose.net/detail/6249788.html

Guess you like

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