Teach you to create a project in gitcode, upload the project, and complete the construction of the project

Summary

GitCode is an open source project innovation service platform provided by CSDN for developers. Adhering to the open source values ​​of "innovation, openness, collaboration, and sharing", it is committed to empowering large-scale open source, open, collaborative innovation, and creating innovative achievements and new era developers. Cultivated open source innovation ecology! Supports public cloud use, private deployment, and private deployment with software and hardware integration.
Project address: https://gitcode.net/explore/welcome
insert image description here
This article shows you how to use gitcode to complete the construction of the project from scratch.

Install and configure git

download git

download link:

https://git-scm.com/downloads

After clicking the link, choose according to the system, my computer is Win11, so choose Windows.
insert image description here
Click on the location of the red box to download git. Of course, the link below also provides other versions, if you are interested, you can try it!
insert image description here
Impressive speed! ! ! ! ! !
insert image description here
Finally the download is complete, and the next step is to start the installation
insert image description here

install git

Double-click the downloaded exe, as shown in the figure below:
insert image description here
Click Next.Installation
insert image description here
location, you can choose the default path or customize the path. Install it wherever you like.
insert image description here
Select the items to be installed, and simply mark a few. If there is no special requirement, just use the default! ! ! ! ! !
insert image description here
Git in the box can be changed to another name, or click "Browse..." to select another folder or tick "Don't create a Start Menu folder" to not want a folder, and click Next.
insert image description here
Choose the Git default editor. There are 10 built-in editors in the Git installer for you to choose from, such as Atom, Notepad, Notepad++, Sublime Text, Visual Studio Code, Vim, etc. The default is Vim.
insert image description here

If you don't want to use Vim as the default editor and change it to another one, such as Notepad++, then you need to click on the blue font "Notepad++" below.
insert image description here

Go to its official website to download and install. Next can only be performed after installation.
insert image description here
The first is to let Git choose by itself, the name is master, but it may be changed to other names in the future; the second is for us to decide on our own, the default is main, of course, you can also change it to other names. Generally, the default is the first one, click Next.
insert image description here
The first is to use Git only from Git Bash. This means that you can only use Git through Git Bash after Git is installed, and other third-party software such as command prompts will not work.
The second is Git from the command line as well as third-party software. This is third-party support on the first basis, you will be able to use Git from Git Bash, command prompt (cmd) and Windows PowerShell, and any third-party software that can find Git from Windows system environment variables.
The third is to use Git and optional Unix tools from a command prompt. Selecting this will override Windows tools such as "find and sort". Use this option only if you understand its implications.
The second is recommended.

insert image description here
Choose Default
insert image description here
to choose the HTTPS backend transport. If you are using Git in an organization with an enterprise management certificate, you will need to use a secure channel. If you only use Git to access public repositories (such as GitHub), or your organization doesn't manage its own certificates, then using an SSL backend (which are just different implementations of the same protocol) should be fine. So choose the first one by default.

insert image description here
Configure end-of-line conversion.
Check out Windows-style, submit Unix-style line endings.
Check out as-is, commit Unix-style line endings.
Check out as is, commit as is.
The first item is selected by default because we are installing the Windows version. Next

insert image description here
MinTTY has more functions than cmd. cmd is more suitable than MinTTY to deal with some interface problems of Windows. This is not very useful for Git. In addition, the default console window (cmd) of Windows has many disadvantages. For example, cmd has very limited Default history scrolls back the stack and poor font encoding and more. Just select the default, Next.

insert image description here
Select the default "git pull" behavior. The first is merge, the second is rebase, and the third is direct acquisition.
Generally, the first option is selected by default. Most programmers can’t use git rebase well or don’t understand it. Next.

insert image description here
There are two options: Git credential management and no credential helper.
With the first option, Git has the user's credentials to perform operations; for example, a username and password may be required to access a remote repository (GitHub, GItLab, etc.) over HTTP. The first one is selected by default, Next.
insert image description here
There are two options: enable filesystem caching, and enable symlinks.
Enabling file system caching means reading file system data in batches and caching them in memory for certain operations, which can significantly improve performance. This option is enabled by default.
Enable symbolic link, symbolic link is a special kind of file, which contains a reference pointing to other files or directories in the form of absolute path or relative path, similar to the Windows shortcut, not exactly the same as under Unix (such as Linux) symbolic link. Because the support of this function requires some conditions, it is not enabled by default.
insert image description here
It is an experimental function, there may be some minor bugs and the like, it is recommended not to enable it.
Click Installto install. Wait for the installation to complete.
insert image description here

Register and log in to gitcode to register an account and create a new project

First register an account on GitCode and log in.
If you have a CSDN account, you can log in directly with the CSDN account. The email address used to log in to the account will be used later.

New Project

Select New Project, as shown in the figure below:
insert image description here
Then, choose to create a blank project.
insert image description here
Fill in the project name and click New Project.
insert image description here
Then, a command guide is generated.
insert image description here

command guide

You can also upload an existing file from your computer by following the instructions below.

Git global settings

git config --global user.name "AI浩"
git config --global user.email "[email protected]"

Create a new warehouse

git clone [email protected]:hhhhhhhhhhwwwwwwwwww/yolov5_counting.git
cd yolov5_counting
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Push an existing folder

cd existing_folder
git init
git remote add origin [email protected]:hhhhhhhhhhwwwwwwwwww/yolov5_counting.git
git add .
git commit -m "Initial commit"
git push -u origin master

Push to an existing Git repository

cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:hhhhhhhhhhwwwwwwwwww/yolov5_counting.git
git push -u origin --all
git push -u origin --tags

Before uploading folders and files, we have one more step to do and that is to generate SSH keys.

generate ssh key

Since the transfer between our local git repository and the GitCode repository is encrypted via SSH, we need to configure the SSH key. Excuting an order:

ssh-keygen -t rsa -C "[email protected]"

Follow the prompts and press Enter three times to generate the ssh key. As shown in the figure below:
insert image description here
As you can see, the path of the public key file id_rsa.pub we generated is: C:/Users/wh109/.ssh/id_rsa.pub
insert image description here
Then, open it with Notepad.
insert image description here
Copy the entire contents of the key, then add it to gitcode, click Settings, then, click SSH Keys.

insert image description here
Put the copied key into the text box below, set the title, and add the key.
insert image description here

Upload files to the repository

After completing the above operations, the local files can be synchronized to the warehouse. Enter the root directory of the local project, and then execute:

cd existing_folder
git init
git remote add origin [email protected]:hhhhhhhhhhwwwwwwwwww/yolov5_counting.git
git add .
git commit -m "Initial commit"
git push -u origin master

The local project can be synchronized to the warehouse.
insert image description here
insert image description here
insert image description here

Reference article:
https://blog.csdn.net/mukes/article/details/115693833
https://blog.csdn.net/linxinfa/article/details/108730290

Guess you like

Origin blog.csdn.net/hhhhhhhhhhwwwwwwwwww/article/details/131674284