table of Contents
- Submit content (take setting up the port and submit the configuration file as an example)
- Resolve conflicts (take modifying the port and submitting the configuration file as an example)
- Management branch
- Enter the branch directory
- Create branch
- Switch branch
- View current branch
- Delete branch
- Branch and trunk synchronization
- Merge branch
aims
- Proficiency in uploading projects to GitHub using Git;
- Proficient in version control using Git.
ready
- Git has been installed locally;
- Have their own GitHub account.
Create a Spring Boot project (In order to be closer to production, I will upload the project as an example.)
Visit https://start.spring.io/ , set relevant dependencies and download the project:
Create a GitHub repository
Step 1 : Visit and log in to the GitHub official website ;
Step 2 : Create a warehouse;
Upload the project to GitHub via HTTPS
Step 1 : Record the HTTPS address of the GitHub warehouse;
Step 2 : Initialize the local warehouse in the workspace where the project is located;
Step 3 : Create name and email;
git config --global user.name 账号
git config --global user.email 邮箱名称
Step 4 : Add items to the temporary storage area;
Step 5 : Add the contents of the temporary storage area to the warehouse;
Step 6 : Submit the project to the GitHub repository;
/*依次执行*/
git remote add origin https://github.com/ashen64/my_rep.git
git push -u origin master
Step 7 : Refresh the GitHub repository, and you can see the project just uploaded.
Upload the project to GitHub via SSH
Step 1 : Record the SSH address of the GitHub warehouse;
Step 2 : Generate the key;
Step 3 : Configure the key;
Step 4 : Initialize the local warehouse in the workspace where the project is located;
Step 5 : Create name and email;
git config --global user.name 账号
git config --global user.email 邮箱名称
Step 6 : Add items to the temporary storage area;
Step 7 : Add the contents of the temporary storage area to the warehouse;
Step 8 : Submit the project to the GitHub repository;
/*依次执行*/
git remote add origin [email protected]:ashen64/my_rep.git
git push -u origin master
Step 9 : Refresh the GitHub repository, and you can see the project just uploaded.
Get the project
Get items with HTTPS
The first step : clone the project on GitHub into your own workspace;
Step 2 : Open this project with idea;
Get the project with SSH
The first step : clone the project on GitHub into your own workspace;
Step 2 : Open this project with idea (omitted);
version control
Submit content (take setting up the port and submit the configuration file as an example)
Step 1 : Submit the file to the local library;
Step 2 : Submit files to the remote warehouse;
Resolve conflicts (take modifying the port and submitting the configuration file as an example)
Step 1 : Submit the file to the local library, you can find that the color of the file name is not green , but blue , indicating that there is a conflict;
Step 2 : Submit files to the remote warehouse (omitted, same as the second step of submission content );
Management branch
Enter the branch directory
Create branch
Switch branch
View current branch
Delete branch
Branch and trunk synchronization
Merge branch
The first step : Check whether the current role is the trunk, and switch to the trunk if it is not the trunk (omitted, the same as switching branches );
The second step : merge branches;
Step 2 : Submit content (omitted, same as submitting documents ).