Change the Local Branch HEAD in a Linked Git Repository

When you link a visual application to a Git repo in a Visual Builder Studio project, the branch HEAD in your local copy, by default, references the most recent commit that was pulled or pushed. If the commit referenced by the current local HEAD is removed from the remote branch (for example, because somebody rebased the remote branch and garbage collection occurred), push and pull requests will fail. In this scenario, you can change the current branch HEAD to use the latest branch head or any other commit to resolve the issue.

To change the branch HEAD in your local copy of a linked Git repository:

  1. Open your visual application.
  2. Click the Git icon and select Link Visual Builder Studio Git Repository.
  3. Click Edit Link to change details of the Git repository linked to your visual app.

    In the dialog box that opens, the Branch Head field shows the current remote branch head of the selected branch. The Custom HEAD field shows the current local HEAD. If Custom HEAD is not the same as the branch head, then the Use Custom HEAD option will be selected initially, as shown here:
    Description of git-repo-change-head.png follows
    Description of the illustration git-repo-change-head.png

    If you select a different branch, the Use Custom HEAD option won't be selected; it will stay that way if you reselect the original branch.

  4. To change the current local branch HEAD, select Use Custom HEAD, then enter the revision ID you want to use in the Custom HEAD field.

    The revision ID (also known as the commit ID in Git) is a 40-character SHA-1 hash. See Get the Revision ID of a Commit in Building Responsive Applications with Visual Builder Studio for information on how you can find a particular revision ID.

  5. Click Save Configuration, then Close.
You can now use the push and pull commands in your visual app's Git menu to push and pull sources that match the new branch head.