In order to change the data directory, you need to add git_data_dirs in /etc/gitlab/gitlab.rb

STEP 1. Add default directory in /etc/gitlab/gitlab.rb

You can find a point can add your own data directory in /etc/gitlab/gitlab.rb - below shows in my case:

git_data_dirs({
    "default" => { "path" => "/home/git"}
 })


STEP 2. Stop GitLab

sudo gitlab-ctl stop


STEP 3. Copy all the data in the default repository to new location

sudo su git
rsync -av /var/opt/gitlab/git-data/repositories /home/git/
exit


STEP 4. Upgrade settings

sudo gitlab-ctl upgrade


STEP 5. Start GitLab

sudo gitlab-ctl start