Created
September 2, 2016 21:13
-
-
Save oleksiialeksieiev/eb035fc8739447a21248abec32b8c12d to your computer and use it in GitHub Desktop.
Git cheat sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GERRIT_SSH_USER=<user> | |
GERRIT_HOST=<gerrit_ip_or_host> | |
GERRIT_PORT=29418 # by default | |
#download commit-message hook | |
gitdir=$(git rev-parse --git-dir); scp -p -P ${GERRIT_PORT} ${GERRIT_SSH_USER}@${GERRIT_HOST}:hooks/commit-msg ${gitdir}/hooks/ | |
chmod +x .git/hooks/commit-msg | |
#Adding "Verified" label | |
mkdir tmp | |
cd tmp | |
git init | |
git remote add origin ssh://$GERRIT_SSH_USER@$GERRIT_HOST:$GERRIT_PORT/All-Projects | |
git fetch origin refs/meta/config:refs/remotes/origin/meta/config | |
git checkout meta/config | |
cat >> project.config <<EOF | |
[label "Verified"] | |
function = MaxWithBlock | |
value = -1 Fails | |
value = 0 No score | |
value = +1 Verified | |
EOF | |
git commit -a | |
git push origin meta/config:meta/config | |
#Setting email address for User using CLI | |
#https://gerrit-review.googlesource.com/Documentation/cmd-set-account.html | |
ssh -p 29418 $GERRIT_SSH_USER@$GERRIT_HOST:$GERRIT_PORT gerrit set-account account-name --add-email account@domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#push for review | |
git push origin HEAD:refs/for/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment