Gitlab setup, rake fails because no --global user.name - gitlab

Following the 5.1 instructions to install gitlab
https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
When I run the command to test the install, I get an error "Git configured for user? ... no"
root#gitlab:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
Git configured for git user? ... no
Try fixing it:
sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "gitlab#gitlab.ac"
For more information see:
doc/install/installation.md in section "GitLab"
Please fix the error above and rerun the checks.
Has python2? ... yes
python2 is supported version? ... yes
At no point in the instructions does it say to setup a user.name and user.email for the git user.
Can I safely ignore this warning, or should I deviate from the instructions and set it?

You are right it doesn't. This configuration is needed when you edit something from the web interface. I sent a pull request to include it in installation docs.

Related

Is there a way for Jenkins or Crontab to push commits automatically to a GitHub repo?

I've been trying to push commits created with a simple shell script:
cd $dir
git add . && git commit -m "Test commit" &&
git push --all origin
The script does the job perfectly. Yet Crontab is stuck at making commits locally and Jenkins is getting 'Permission denied' when accessing a local git folder even if I assign Jenkins a group that owns the folder.
I tried Jenkins jobs with Execute shell either with the code or the path to the script. Any help would much appreciated.
One thing to note is that Jenkins goes back to the original workspace to run each command. So when you run cd $dir, the script will switch to $dir, but once you start the git add... command, it will go back to your workspace directory. To prevent this, either chain the commands together:
cd $dir && git add . && git commit -m "Test commit" && git push --all origin
or use dir to wrap the git commands so that they always run in that specific directory.
As advised by #M B summarizing:
Crontab:
For the cron commits to be pushed automatically:
Add a hook file to your git directory:
How can I automatically push after committing in Git?
Jenkins:
To commit and push automatically add a node. I also added to a sudoers file by sudo visudo:
jenkins ALL=(ALL) NOPASSWD: ALL
%sudo ALL=(ALL:ALL) ALL
I have also assigned a safe directory:
git config --global --add safe.directory /path/to/your/git/dir
EDIT: Just tested with Amazon EC2 Plugin, after cloning the repo on an EC2 instance use:
git remote remove origin
git remote add origin https://ghp_TOKEN#github.com/USER/REPO.git
git add . && git commit -m "COMMIT" && git push --all origin
And these 3 also work for Crontab and Terraform (no other settings needed).
Hope this helps.

Gitaly installation end without _build/bin/gitaly

I'm installing gitlab from source and I found this no 'gitaly' in bin folder. And 'bin' folder is totally missing in /home/git/gitalt/_build.
sudo -u git -H bundle exec rake "gitlab:gitaly:install[/home/git/gitaly,/home/git/repositories]" RAILS_ENV=production
I have run it without errors and no idea here.
Can you help me? Any comment is welcome.
Thank you.
Answer myself.
fixe it with changing account to git and doing without 'su'.
su - git && cd gitlab && bundle exec rake ...

This Git command (git commit -m 'initial') cannot execut [duplicate]

This question already has answers here:
Git: Please tell me who you are
(3 answers)
Closed 2 years ago.
when I run the git commit -m 'initial' command it shows me the below error
Author identity unknown
Please tell me who you are.
Run
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
to set your account's default identity. Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address
The Git tells you to set your identity before doing git operations. So, complete that by entering the git commands.
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
THese commands are used to set your identity to your git terminal after setting this up. you can able to do the git operations you want

Gitlab 6.0 is not creating new repository

I'm trying to create a new project in 6.0. Gitlab says that repository was created successfully, but there is no repository created.
I was able to create project with repositories before. Suddenly these newly created repositories are not published on server.
Any help is highly appreciated!
Please switch in your gitlab install directory and run these commands to check your installation. Maybe something is not running:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

git: 'pull' is not a git command - CentOS VPS server

I recently set up a new VPS and have installed Git via yum and wget etc. All seemed well - I can add, commit, set up a remote and push to github.
However, when I try to pull from github:
user#domain.com [~]# git pull github master
git: 'pull' is not a git command. See 'git --help'.
Did you mean this?
shell
No, I didn't mean shell, I meant pull!
Now I've googled the heck outta this - including reading several posts on Stackoverflow:
"git pull" broken
git: 'pull' is not a git command. See 'git --help'
Although most posts seem to be about Mac issues (I'm on a CentOS server), it seems to be an issue with the git exec path, which is
user#domain.com [~]# git --exec-path
/usr/local/libexec/git-core
I've tried adding a various things to .bashrc with no success.
The key thing is that when I cd down to /usr/local/ and ls -l, I can't see a libexec directory.
But if I log in as root, I can cd to /usr/local/ and see libexec/, inside which is git-core. I can also git pull as root.
So - I suspect the problem is more to do with permissions and the server setup than git itself.
I've tried
sudo chmod a+rx /usr/local/libexec
But that did nowt too...
When I ssh into another server, as an account user, I can cd down to /usr/local and see libexec - so there's something wrong with this server setup.
Any ideas gratefully received.
Solved it now - the server is using jailshell... Disabling jailshell and using 'normal' shell works a treat

Resources