need more understanding on gitblit groovy push script

I have below groovy script

PushCommand push=git.push();
push.setRemote("my remote");
push.setPushAll(); //Push all branches under refs/heads/*.
push.setForce(true); //Sets the force preference for push operation.
push.call();

My requirement: want to push only changes from one gitinstance to other

  • How to avoid rebase hell when merge commits are in the way?
  • Cherry-pick Commit from a different repo
  • AWS CodeDeploy can't find github tar link for private repository “could not download bundle”
  • How to gitignore everything except hidden subdir?
  • Git add through python subprocess
  • How can I verify git clone is working correctly?
  • setPushAll : Is this going to push all repository data all time script executed or just commied changes(I want change only)?

    push.setForce(true) : What is use of this ? Should I use it in my case ?

  • how to abort merge of a specific file using git?
  • Should Git track the “typings” folder? (typings.json)
  • How to Organize related applications into git repo's?
  • git rebase vs git cherry-pick of detached branch
  • Difference between git merge and git fetch?
  • Android Studio push tags to remote
  • One Solution collect form web for “need more understanding on gitblit groovy push script”

    Got answer what I want to know As in comment

    Git only pushes what is not in the target

    setForce(true) will override references in the target repo with the references in the source repo. For your situation this is probably what you want. – James Moger

    setPushAll will push all branches from the source to the target. This is also probably what you want. – James Moger

    you can lookup in the man-page (or docs) of git-push – cfrick

    Git Baby is a git and github fan, let's start git clone.