Gitub builds project warehouse

1. Git basic commands

Create
Copy project: git clone warehouse address
Create branch: git branch branch name
Enter branch: git checkout branch name
Create and enter branch: git checkout -b branch name


Upload
View status: git status
Add all files: git add.
Submit: git commit -m'Submit description'
pull: git pull
push: git push


View
View all local branches: git branch --list
View all branches (including remote branches): git branch -a


Delete
Delete local branch: git branch -d branch name
Delete remote warehouse branch: git push origin --delete branch name


2. Build the project

2.1 Enter gitub official website to create a project first

Insert picture description here


2.2 Build project information

Insert picture description here


2.3 Copy Https address

Insert picture description here


2.4 New local warehouse

2.4.1 Right-click to open git bash
(you can click the official website to download without Git )

2.4.2: git clone address
(Https address copied just now)
Insert picture description here
2.4.3:
Enter the generated folder
Insert picture description here

Right-click and select git bash and
use the git branch command to know that you are currently in the main branch
Insert picture description here
git branch dev. The
new branch is named dev, and the name can be anything you want

Insert picture description here

git checkout dev
enter dev
Insert picture description here
**git push **
upload branch
Insert picture description here
copy input git push --set-upstream origin dev

Insert picture description here
The branch upload is successful.
Similarly, you can create a new branch to start the project, and record the version
Insert picture description here


3 upload project

How to upload remote warehouse after some projects are completed

View status: git status
Add all files: git add.
Commit: git commit -m'Submit description'
pull: git pull
push: git push

Enter the above commands in turn to
view the current status, add all files, submit the selection description content,
and you can not use git pull and
finally git push for personal development.

Guess you like

Origin blog.csdn.net/qq_43522998/article/details/110563424