In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Can Tencent Cloud set up a git server? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
Tencent Cloud can set up git servers. Git is an open source distributed version control system, which can effectively and high-speed deal with project version management from very small to very large. It is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
Version control is an integral part of a project, which can help developers track file changes, branch management, version fallback, version release, and so on. Because of its open source, distributed, fast and efficient characteristics, Git has become the first choice of version management system.
1. Remote repository, build Git server does not need any complex tools, because the git tool already includes all the functions.
two。 Install git. General Linux distributions already have built-in git. If not, install sudo apt-get install git.
3. Add user sudo adduser git this user is used to run the git server and is distinguished from ordinary users on the CVM. When the local git client interacts with the remote repository, the user used to run the git program on the cloud is the git that has just been added. Set the password for the user: sudo passwd git
4. Disable login git, because user git is mainly used as a warehouse, ordinary people cannot and should not log in and enter git, so use the tool git-shell to prohibit user git from logging in shell.
First add / usr/bin/git-shell to / etc/shells as the available shell;sudo vim / etc/shells, and then change the default shell of the user git. Sudo chsh git-s git-shell
5. To create a warehouse, since the login of user git has been disabled, we can directly use the root permission to create a directory of all remote repositories on the / home/git directory srv/ sudo mkdir / home/git/srv. At this time, you can create an empty remote warehouse on srv/ with the command:
Sudo cd / home/git/srv
Sudo git init-bare elephant.git
The-bare parameter indicates the bare warehouse, and the remote warehouse is generally initialized to the bare warehouse. Now it is best to set the permissions of the warehouse, which are managed by the user git, and other users do not have administrative rights.
Sudo chown-R git/ home/git/srv
Sudo chmod-R 770 / home/git/srv
6. Client login, now the client needs to synchronize with the remote warehouse, you can log in with ssh, and git also supports ssh connection. Client needs to create ssh-key, and use ssh-keygen to create public key and private key.
Ssh-keygen-t rsa-C "xxx@email.com"
Windows generally places the generated public key and private key in C:\ Users\ xxxx.ssh\
7. Copy the contents of .ssh\ id_rsa.pub (public key) and put them into the / home/git/.ssh/authorized_keys () of the git user of the CVM to represent the authenticated public key.
At this point, the local git client can pull the git clone git@server:srv/elephant.git to the remote warehouse using the following command
In the above warehouse address, git indicates that the user git,server of the CVM represents the CVM address, that is, the ip of the CVM, and the following indicates the naked warehouse of / home/git/srv/elephant.git on the CVM.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.