Use multiple code hosting platforms such as gitlab, gitee, and github on the same computer

When using multiple code hosting platforms (such as GitLab, Gitee, GitHub, etc.) on the same computer, they need to be configured in different directories to avoid mutual influence. The specific steps are as follows:

1. Configure Git username and email: Run the following commands in the terminal to set the username and email for different code hosting platforms.

git config --global user.name "<your_name>"
git config --global user.email "<your_email>"

2. Create folders: Create multiple folders anywhere locally to store different code repositories. It can be named according to the name of the code hosting platform or the project name.

3. Create a new project on the code hosting platform and clone the project to the corresponding folder. For example, to clone a project on GitHub to a local folder named github, you can run the following command in the terminal:

cd ~/<path_to_github_folder>
git clone https://github.com/<username>/<project_name>.git

Note that in this command the path <path_to_github_folder> should be replaced with the path to the folder where the GitHub project is stored locally, and <project_name> should be replaced with the name of the user who owns the project and the name of the project.

4. For different code hosting platforms, we can adopt different methods for management. For example, you can use different SSH keys or HTTPS credentials for authentication and access. This information can be configured in the settings of the code hosting platform.

Through the above method, you can use multiple code hosting platforms safely and conveniently on the same computer without conflicting with each other.

Guess you like

Origin blog.csdn.net/weixin_43534452/article/details/131440011