Move Projects in Git to Gerrit

630 views
Skip to first unread message

Clinto Sunny

unread,
Dec 12, 2014, 6:41:12 AM12/12/14
to repo-d...@googlegroups.com
I have some projects in My Git Repository. I would like to move all that to Gerrit. I am not mentioning about importing projects one by one from git and pushing it to Gerrit as it might take a lot of time as the number of projects in Git is large. Or in other words I can say like I would like to convert the local git repository to the git repo of my Gerrit so that I can get all the existing projects in local Git in Gerrit. For this I gave the Location of Git repositories during gerrit initialization as my local Git Repository and tried but I didnt get the result which I was looking for. Though All-Projects.git came there, in the Gerrit UI other projects in the local Git repositories were not listed. Is there anyway to do this? It would be greatly helpful if someone could help me to solve this.
Thank you 

Alex Blewitt

unread,
Dec 12, 2014, 6:54:19 AM12/12/14
to Clinto Sunny, repo-d...@googlegroups.com

On 12 Dec 2014, at 11:41, Clinto Sunny <clin...@gmail.com> wrote:

I have some projects in My Git Repository. I would like to move all that to Gerrit. I am not mentioning about importing projects one by one from git and pushing it to Gerrit as it might take a lot of time as the number of projects in Git is large. Or in other words I can say like I would like to convert the local git repository to the git repo of my Gerrit so that I can get all the existing projects in local Git in Gerrit. For this I gave the Location of Git repositories during gerrit initialization as my local Git Repository and tried but I didnt get the result which I was looking for. Though All-Projects.git came there, in the Gerrit UI other projects in the local Git repositories were not listed. Is there anyway to do this? It would be greatly helpful if someone could help me to solve this.
Thank you 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Clinto Sunny

unread,
Dec 12, 2014, 7:00:13 AM12/12/14
to repo-d...@googlegroups.com, clin...@gmail.com
I agree to that. That method is for moving projects one by one. But I would like to convert my local git repository to my gerrit's git repository. I am asking for a method for that.

Alex Blewitt

unread,
Dec 12, 2014, 7:07:40 AM12/12/14
to Clinto Sunny, repo-d...@googlegroups.com

Clinto Sunny

unread,
Dec 12, 2014, 7:16:23 AM12/12/14
to repo-d...@googlegroups.com, clin...@gmail.com
Thank you. But I am sorry to say that it is not clear for me. Could you give me a clear picture of what is to be done. 

Matthias Sohn

unread,
Dec 12, 2014, 7:28:16 AM12/12/14
to Clinto Sunny, Repo and Gerrit Discussion
On Fri, Dec 12, 2014 at 12:41 PM, Clinto Sunny <clin...@gmail.com> wrote:
I have some projects in My Git Repository. I would like to move all that to Gerrit. I am not mentioning about importing projects one by one from git and pushing it to Gerrit as it might take a lot of time as the number of projects in Git is large. Or in other words I can say like I would like to convert the local git repository to the git repo of my Gerrit so that I can get all the existing projects in local Git in Gerrit. For this I gave the Location of Git repositories during gerrit initialization as my local Git Repository and tried but I didnt get the result which I was looking for. Though All-Projects.git came there, in the Gerrit UI other projects in the local Git repositories were not listed. Is there anyway to do this? It would be greatly helpful if someone could help me to solve this.
Thank you 

Put the (bare) repositories under the git root folder of your Gerrit installation and
either restart the server or flush the project-list cache [1]. Then they should show
up in Gerrit's project list.


--
Matthias

Alex Blewitt

unread,
Dec 12, 2014, 7:37:12 AM12/12/14
to Clinto Sunny, repo-d...@googlegroups.com
for project in projectlist
do
  ssh ... gerrit create-project --name $project
done


Sent from my iPhat 6

Jan Kundrát

unread,
Dec 12, 2014, 11:41:12 AM12/12/14
to repo-d...@googlegroups.com
On Friday, 12 December 2014 13:28:12 CEST, Matthias Sohn wrote:
> Then they should show up in Gerrit's project list.

...and an in undefined state, with undeifined parent, and no
refs/meta/config branch. Not good.

With kind regards,
Jan

--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/

Clinto Sunny

unread,
Dec 13, 2014, 2:27:59 AM12/13/14
to repo-d...@googlegroups.com, clin...@gmail.com
I copied my .git folder in git repo into the git repo locaiton of gerrit. But I am not able to import the project into Eclipse. What I did is I copied the .git folder to the gerrit's git repo and renamed it as xyz.git and tried to import that into eclipse. But I am not able to get the desired result. 

Matthew Webber

unread,
Dec 18, 2014, 8:32:27 AM12/18/14
to repo-d...@googlegroups.com


On Friday, December 12, 2014 4:41:12 PM UTC, Jan Kundrát wrote:
> Then they should show up in Gerrit's project list.

...and an in undefined state, with undeifined parent, and no
refs/meta/config branch. Not good.

It worked for me (Gerrit 2.10rc) . I did something like this:
TMPDIR=/tmp/repocopy
rm -rf ${TMPDIR}/
mkdir -pv ${TMPDIR}/
 
repo_name=blahblah
git clone --mirror ssh://pre-gerrit-url/${repo_name}.git ${TMPDIR}/${repo_name}.git
cd ${TMPDIR}/${repo_name}.git
git config --remove-section remote.origin
git config --add core.symlinks false
git config --add core.logallrefupdates true
cat config

Then simply restarted the Gerrit server.


Reply all
Reply to author
Forward
0 new messages