GitLab uses
Reprint linkCreate your first managed project
Click +
No. -->新建项目
Enter the project name and description information, set the visibility level to private, so that others cannot see your project
Initialize the project
We choose to initialize the project by adding a README
Just submit the changes directly
Pull and push projects using SSH
Generate SSH KEY
Generated using the ssh-keygen tool, the location is in the Git installation directory, mine isC:\Program Files\Git\usr\bin
input the command:
ssh-keygen -t rsa -C "[email protected]"
The effect after successful execution:
Microsoft Windows [版本 10.0.14393]
(c) 2016 Microsoft Corporation。保留所有权利。
C:\Program Files\Git\usr\bin>ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Lusifer/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Lusifer/.ssh/id_rsa.
Your public key has been saved in /c/Users/Lusifer/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:cVesJKa5VnQNihQOTotXUAIyphsqjb7Z9lqOji2704E [email protected]
The key's randomart image is:
+---[RSA 2048]----+
| + ..=o=. .+. |
| o o + B .+.o.o |
|o . + +=o+.. |
|.= . oo... |
|= o So |
|oE . o |
| .. .. . |
| o*o+ |
| *B*oo |
+----[SHA256]-----+
C:\Program Files\Git\usr\bin>
Copy SSH-KEY information to GitLab
The location of the key is in: C:\Users\你的用户名\.ssh
directory, find id_rsa.pub
and open it with an editor, such as:
Log in to GitLab, click "User Avatar" --> "Settings" --> "SSH Keys"
The effect after successfully adding the key
Clone the project with TortoiseGit
- Create a new local folder to store the code repository
- Right-click on an empty space in the folder
- Select "Git Clone..."
- Service item address to URL
- If a connection message pops up, select Yes
- Successfully cloned the project to local
Push project (commit code) with TortoiseGit
- Create or modify files (the files here are all files, including: code, pictures, etc.)
- Let's take creating a
.gitignore
filter configuration file as an example. The main function of this file is to filter files that do not need to be uploaded, such as: IDE-generated project files, compiled class files, etc. - In the project directory, create a new
.gitignore
file and fill in the following configuration:
.gradle
*.sw?
.#*
*#
*~
/build
/code
.classpath
.project
.settings
.metadata
.factorypath
.recommenders
bin
build
target
.factorypath
.springBeans
interpolated*.xml
dependency-reduced-pom.xml
build.log
_site/
.*.md.html
manifest.yml
MANIFEST.MF
settings.xml
activemq-data
overridedb.*
*.iml
*.ipr
*.iws
.idea
.DS_Store
.factorypath
dump.rdb
transaction-logs
**/overlays/
**/logs/
**/temp/
**/classes/
- Right-click to call out the menu, select "Submit Master..."
- Click "All" and fill in "Log Information"
- Click "Submit and Push"
- Rendering after success