These two days toss a question about Gitlab, make more and more exhausted. But after the toss, eventually succeeded.
When faced with a problem, and see the time has not been resolved, feeling very uncomfortable;
After the effort, after the solution, will also be physically relaxed. Perhaps the engineer was born "not to solve the problem uncomfortable". It is a habit to change in the future. Here is a brief record.
A. Description of the problem generated:
Two days ago the colleague in Gitlab created a warehouse, Http://121.201.13.32:9000/sbzhou/tsd-collector.git, because all peoject are basically a unified prefix/HTTP// 121.201.13.32:9000/xiaobao/(e.g. Http://121.201.13.32:9000/xiaobao/tsd-thirdparty.git), for coordination and uniformity, we recommend Unified management: Rebuilding Peoject
Operation Step 1, I first through Gitlab to transfer project, the results found transfer, he was unable to submit;
So I have to re-create project,create after the upload of his original project code, there will still be problems.
[Email protected]/e/test/suyx/tsd-Collect (Master) $ git push-u Origin masterusername for 'http://121.201.13.32:9000': Suyxpassword for 'Http://[email protected]:9000': Counting objects:8, done. Delta CompressionusingUp to4threads.compressing objects: -% (6/6), done. Writing objects: -% (6/6),553bytes |0bytes/s, done. Total6(Delta4), reused0(Delta0) Remote:GitLab:You Don't have permissionTo http://121.201.13.32:9000/xiaobao/tsd-collect.git! [Remote rejected] master, master (pre-receive hook declined) error:failed to push some refs to'Http://121.201.13.32:9000/xiaobao/tsd-collecT.git'
Two. Resolution process:
1. Check the system configuration, found, here say, students install Gitlab, you can only use this installation: Bitnami-gitlab-7.6.2-0-linux-x64-installer.run
You can start with the following command:./ctlscript.sh start
In addition, to view the log, you can go to the location view:/home/git/gitlab-shell/gitlab-shell.log
/opt/gitlab-7.6.2-0/apps/gitlabci/htdocs/log/sidekiq.log
Some of the configuration files can be found here:/opt/gitlab-7.6.2-0/properties.ini
Reference: http://www.koofun.com/showcode.html?id=29706&l=en
Here are a few common commands for you to refer to:
GitGlobalsetupgit config--GlobalUser.Name"Haochuang"git config--GlobalUser.email"[email protected]"Create aNewRepositorymkdir TSD-COLLECTCD TSD-collectgit Inittouch readme.mdgit add readme.mdgit commit-M"First commit"git remote add origin [email protected]121.201.13.32: xiaobao/tsd-Collect.gitgit Push-u Origin masterpush an existing Git REPOSITORYCD existing_git_repogit Remote add origin [email protected]121.201.13.32: xiaobao/tsd-Collect.gitgit Push-U Origin Master
Three. Final Solution:
1. Improve the equipment configuration;
2. Modified some of the configuration files, increase the resource configuration, to ensure that the HTTP link is available;
3. Clear the duplicate repo, ensure the server side clean;
4. Rebuild the Git repository, re-clean and check, and adjust permissions;
Four. Problem cause analysis and review:
Reference: Https://bitbucket.org/site/master/issues/7522/remote-rejected-master-master-pre-receive
Repetition can cause problems;
Five. Operation notes:
Note 1: When creating the project for the first time, remember to do the following:
git remote add origin [email protected]:<your name>/<appname>
The first time you need origin, add repository, and then push your code to repository.
Typically, after you push to GitHub, Git push master is deployed to master.
Note 2: When using git, learn about Git's basic use of flow, and make it as common as possible for everyone in the team to understand and use:
https://about.gitlab.com/2014/09/29/gitlab-flow/
For some claims to work for 15 years, but only to do a bit of the microphone, will only use TORORSIESVN GUI to submit code, even git is not good, can only say in the work with such a person the farther the better, lest by its influence, be brought out bad habits.
Note 3: For project creation and deletion, it is best to unify management.
Of course, the best is the company can have their own SCM personnel, lest some people operation error, after the problem, delay other engineers to help repair, delay time.
A problem solving about the Gitlab