简体   繁体   中英

How to configure Android studio with gerrit commit and push

We have been using gerrit as our android source code repo. We usually use git bash commands to do push ,pull and commit for working with gerrit.I want to how we can configure the android studio itself with gerrit so that i don't need to type in commands in git bash. I tried to change some settings in the Android studio in git version control option but that really didn't work. One more thing is that whenever we do a commit through git commit command git creates (or something else i am sure as i am not very good at git commands and env) changeId: This is very important for pushing/amending the changes.How can i add changeId while i commit from studio.

Let me know if i am not very clear about my question , i will add more.

This is the image of my push Ui from studio where i can't see the origin HEAD :

在此处输入图片说明

Android Studio's Git GUI should be able to do almost all the jobs through menus and buttons. The only annoying thing may be that you need to change the remote ref in the push menu from master or refs/heads/master to refs/for/master to create changes for review.

Change-Id is created by a hook commit-msg . As I know, it is under repo/hooks if you use Google's REPO. The repositories cloned by repo sync have commit-msg deployed, so you don't need to worry about it. But as for those repositories created by git clone or git init , you need to install it. Gerrit's project page provides a clone command which includes scp that downloads and copies the hook automatically. If you clone through Android Studio, you could manually install it under .git/hooks/ for one repository, or copy it to $GITBASH/ming64(32)/share/git-core/template/hooks on Windows so that any new created repository will have it installed automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM