git-http-push - Linux


git-http-push pushes commits from a local repository to a remote repository exposed over an HTTP connection. It is useful for transferring commits to remote servers that do not support SSH or other protocols.


git http-push [-q | --quiet] [-v | --verbose] [-p | --progress]
             [-n | --dry-run] [-f | --force]
             [-t | --tags] [--no-tags]
             [<base-url>] <branch>:<remote-branch>


  • -q, --quiet: Suppress progress output.
  • -v, --verbose: Show verbose progress output.
  • -p, --progress: Show progress updates during the push.
  • -n, --dry-run: Do a dry run without actually pushing commits.
  • -f, --force: Force the push even if the remote branch already exists and has diverged from the local branch.
  • -t, --tags: Push tags along with the commits.
  • --no-tags: Do not push tags.


Push a single branch:

git http-push main:refs/heads/main

Push all branches:

git http-push refs/heads/*:refs/heads/*

Force push a branch:

git http-push -f main:refs/heads/main

Dry run:

git http-push --dry-run main:refs/heads/main

Common Issues

  • Permission denied: Ensure you have sufficient write permissions to the remote repository.
  • Remote repository not found: Verify that the specified base URL is correct and the remote repository exists.
  • Diverging branches: If you encounter a merge conflict due to the remote branch having diverged, you can use -f to force the push, or try rebasing your local changes onto the remote branch.


With GitLab CI:

image: docker:latest

  stage: deploy
    - git fetch --unshallow

Related Commands

  • git push: Similar command that uses SSH by default.
  • git clone: Creates a new local repository by copying contents from a remote repository.