File indexing completed on 2024-05-12 04:17:32

0001 #!/bin/bash
0002 
0003 # ===========================================================
0004 #
0005 # This file is a part of digiKam project
0006 # https://www.digikam.org
0007 #
0008 # Date:        2016-08-15
0009 # Description: Script to rename remote git branch.
0010 #
0011 # Copyright (C) 2017-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0012 #
0013 # SPDX-License-Identifier: BSD-3-Clause
0014 #
0015 # ============================================================
0016 
0017 if [ $# -ne 3 ]; then
0018     echo "Rationale : Rename a branch on the server without checking it out."
0019     echo "Usage     : $(basename $0) <remote> <old name> <new name>"
0020     echo "Example   : $(basename $0) origin master release"
0021     exit 1
0022 fi
0023 
0024 git push $1 $1/$2:refs/heads/$3 :$2