Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Git change remote branch name

1. Verify the local branch has the correct name:
git branch -a

2. Next, delete the branch with the old name on the remote repository:
git push origin ––delete old-name

3. Finally, push the branch with the correct name, and reset the upstream branch:
git push origin –u new-name

Alternatively, you can overwrite the remote branch with a single command:
git push origin :old-name new-name
Resetting the upstream branch is still required:
git push origin –u new-name
Comment

switch to remote branch git

# creates a branch called some_branch
# switches to this newly created branch
# pulls changes from the origin remote branch
git checkout -b some_branch origin/some_branch
Comment

git replace local branch with remote

git fetch
git reset --hard origin/{{branch}}
# replace {{branch}} with name
Comment

git change branch remote

git branch branch_name --set-upstream-to your_new_remote/branch_name
Comment

git replace local branch with remote

Delete your local branch: 							git branch -d local_branch
Fetch the latest remote branch: 					git fetch origin remote_branch
Rebuild the local branch based on the remote one:	git checkout -b local_branch origin/remote_branch
Comment

git branch change remote

git branch branch_name -u your_new_remote/branch_name
Comment

PREVIOUS NEXT
Code Example
Shell :: install bootstrap vue laravel 7 
Shell :: QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket 
Shell :: are github and git same thing 
Shell :: linux dd show progress 
Shell :: how to install deb package with apt 
Shell :: npm list versions of installed packages 
Shell :: bash find file in directory 
Shell :: docker redis 
Shell :: how to download youtube videos in ubuntu 20.04 
Shell :: git change ssh key 
Shell :: debian 9.4 telnet install 
Shell :: code to change the mac address kali linux 
Shell :: resolve merge conflicts git 
Shell :: localhost ssl 
Shell :: warning: LF will be replaced by CRLF 
Shell :: surge flutter web 
Shell :: how to update to latest version of chrome in ubuntu 17.04 
Shell :: como instalar brew en linux 
Shell :: install grammarly on mac brew 
Shell :: add user to docker group 
Shell :: install aws cli v2 
Shell :: windows terminal guid 
Shell :: git showing ignored file modified 
Shell :: uninstall mongo db 
Shell :: how to install a library in anaconda 
Shell :: ionic capacitor android 
Shell :: batch delete all files in subfolders of type 
Shell :: curl download file without output 
Shell :: how to open sublime in linux 
Shell :: upgrade ubuntu command line 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =