If you have fewer people using git, you can use the following steps to quickly deploy a GIT server environment.1. Generate the SSH public keyEvery engineer who needs to use a GIT server needs to generate an SSH public keyGo to you
, the machines can talk to each of the other. Run the following command on your local machine:Cat ~/.ssh/id_rsa.pub | SSH [email protected] "Mkdir-p ~/.ssh cat >> ~/.ssh/authorized_keys"Now ssh to the server and create a project directory for Git. You can use the desired path for the repo.[Email protected]:~ $ mkdir-p/home/swapnil/project-1.gitThen change to thi
-keygen-t rsa # enter without a password# Upload the public key to the server (default SSH port 22) scp ~ /. Ssh/id_rsa.pub root @ server IP:/tmp4. Return to the server and initialize gitosis.# Create git version management User gitsudo adduser git # change gitUser passwordS
GIT server for automatic web code deployment
Here, we will briefly record how the GIT server can automatically deploy web code.
1. git mechanism Overview
Git uses a code repository. The
protected]:gitosis-admin.git#cd repository/gitosis-admin.git/Add other users to git with git other users use the fifth step to generate the Id_rsa.pub file and send it to you and do the followingView Id_rsa.pub file The name of the file with the value after "= =" for example: [email protected]#cp [email protected] keydir/[email protected]#vim gitosis.confAdd the following at the end of the file[Group Test-
is%s '% (commitmsg, str (signals))Except Subprocess. Calledprocesserror as ERR:Print (' =======%s%s '%s ERROR ======= '% (branch, commitmsg, Err.output))Exit (1)Exit (0)Iv. Deploying the server-side code from git bare repostoryIn this example, I assume that the Git warehouse and the test server are on the same
link https://git.oschina.net/, register the account password, this does not say much. And then create a new project.Here I have created a project called Firstgittest. Note It is best to initialize the project when the Readme.md file is checked, after a lot of description of the nature of the content can be written inside very convenient.4. Add encryption keys for this projectAfter creating the project, because you want to upload to the server on the
Transferred from: http://www.360doc.com/content/12/0503/11/1016783_208316518.shtmlMost of the GIT servers currently on the Windows platform are implemented in a copssh+msysgit way, which is also the most authentic way to build a git server on a Windows platform, providing the highest level of security and flexibility. But the downside is that it's still a hassle
gets a variety of events, and the hooks used here arePost-receiveThis hook is triggered when the GIT server receives a push request and accepts the code submission.The specific code reflects:Create a new post-receive file in the hooks directory of the Git remote repository:
123456789101112131415161718192021222324252627
#!/bin/sh #author: embbnux
SQLite, most of the other is basically optional, must fill in basically have been filled, for individual users, basically directly click "Install Now" can. I have changed the path of the warehouse here, the others have not changed. This is already installed and can be used directly. You can use it directly by registering your account.The installation method is very simple, basically one step can be done. If you need more advanced configuration, see the official note: Configure and run.In this w
The cause and the cause, here no longer tell, directly into the subject of project development, I would like to dedicate to the small partner who likes to study GIT
Project structure:
+ router.php//Routing files
+ app.php//Application files
+ git.php//git operation core files
+ index.php//Entry files
Next, you'll start with a flashback to the GIT
First, the cooperation process referenceIi. Introduction of BranchesMaster Branch: always in a stable state, this branch code can be used at any time to deploy. You are not allowed to submit code directly on this branch.Develop branch: Development Branch, if you want to add a new feature, pull out a branch from the Master branch, and the branch name convention is develop/xxxThird, the specific operation process 1, create a branch or pull a remote ware
follows:
CD Gitroot
mkdir ProjectName
CD ProjectName
Git init--bare
Add our Hooks
Copy Code code as follows:
Cd/hooks
Touch post-receive
Edit Post-receive content for the following, where Sites/projectname is where we store the site code
Copy Code code as follows:
Env-i Git archive Master | Tar-x-c/sites/projectname
echo "Remote Update Comp
One. Install gitEnvironment CentOS 6.5, no net. First mount the offline package and modify Yum to use the local repo#创建挂载点mkdir/media/centos-6.5-/media/centos-6.5-CD2-O loop-t iso9660./centos-6.5-x86_64-bin-dvd1.iso/media/centos-6.5-cd1/-o loop-t iso9660./centos-6.5-x86_64-bin-dvd2.iso/media/centos-6.5-cd2/Using the local repoMv/etc/yum.repos.d/centos-base.repo Centos-base.repo_bakVi/etc/yum.repos.d/centos-media.repo#修改baseurl为 baseurl=file:///media/c
/dalong/demo.git
Modify a Submission
修改index.html 即可
Effect
Heroku application deployment in a similar wayDescriptionHeroku should deploy the model also using a similar approach, when we commit, trigger the build of the app (Nodejs npm install container build, App launch ... )At the same time we use hooks to do a lot more flexible CI/CD developmentResourcesHttps://github.com/gogs/gogsHttps://
1, Baidu search Dropbox, download, as shown in the following picture:
2, Dropbox registration and install the client
Note: If you feel that Dropbox synchronization is slower, you can remove the speed limit of uploads and downloads in preference, as shown in the following figure:
3, in the Dropbox directory to build a directory repo used to store the GIT library (this optional, cas
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.