Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

How do I reset the git master branch to the upstream branch in a forked repository?

You can reset your local master branch to the upstream version and push it to your origin repository.

Assuming that "upstream" is the original repository and "origin" is your fork:

# ensures current branch is master
git checkout master

# pulls all new commits made to upstream/master
git pull upstream master

# this will delete all your local changes to master
git reset --hard upstream/master

# take care, this will delete all your changes on your forked master
git push origin master --force
(You can define the original repo as "upstream" with git remote add upstream /url/to/original/repo.)
Comment

PREVIOUS NEXT
Code Example
Shell :: how to check my git username 
Shell :: how to see deleted commit git 
Shell :: download wine for ubuntu 
Shell :: docker clean images 
Shell :: ArgumentError: Malformed version number string 0.32+git 
Shell :: acce;lerate ubuntu 
Shell :: fail2ban apt 
Shell :: how to remove git hooks 
Shell :: Git change branch from branch to main 
Shell :: BBBBBBBBBBBB 
Shell :: list which process is running on specific port ubuntu 
Shell :: ubuntu remove except file 
Shell :: validate ssl certificate on website using curl 
Shell :: Fix the upstream dependency conflict, or retry this command with --force, or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution. 
Shell :: how to install eclipse in ubuntu 
Shell :: "git reset –- soft head^" 
Shell :: Default gateway -linux 
Shell :: size apache 
Shell :: bash substring after character 
Shell :: error Invalid plugin options for "gatsby-plugin-manifest": 
Shell :: adonis list routes 
Shell :: revert git pull 
Shell :: g++ use c++20 
Shell :: tor mac command line 
Shell :: add an existing user account to a group 
Shell :: git lines of code per user 
Shell :: aws cli config profile 
Shell :: adb find device ip 
Shell :: Clear heroku redis cache 
Shell :: sqlmap enumerate databases 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =