git add local project to remote warehouse

The first step is
to create a local directory (for example: git-test), enter the directory, right-click to execute Git Bash Git

Insert picture description here
The second step
execution git init
Insert picture description here
at this time will be more a .git directory folder
Insert picture description here

Step
3 Create a new file in the directory such as: txt.txt
Insert picture description here

Then run

git add .

git add is to add files to the warehouse

git commit -m "添加代码"

git commit is to submit the staging area to the local warehouse.

Step 4 Upload the local staging area to the remote warehouse

Insert picture description here

 git remote add origin https://gitee.com/****/test-git.git   /// https://gitee.com/****/test-git.git git 仓库地址

git remote add origin uploads the local staging area to the remote warehouse

Then go to the warehouse address to check whether the upload is successful. The success is as follows
Insert picture description here

Operation complete...


Expand

Easy command line tutorial:
Git global settings:

git config --global user.name “****”
git config --global user.email " ***"

Create a git repository:

mkdir test-git
cd test-git
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/****/test-git.git
git push -u origin master

Already have a warehouse?

cd git-dir
git remote add origin https://gitee.com/****/test-git.git
git push -u origin master

Guess you like

Origin blog.csdn.net/super__code/article/details/103781082