Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git move changes to new branch

git switch -c <new-branch>
Comment

git bring your changes to a new branch

git checkout -b <new-branch>
// This will leave your current branch as it is, create and checkout a new branch and keep all your changes. You can then stage changes in files to commit with:

git add <files>
//and commit to your new branch with:

git commit -m "<Brief description of this commit>"
Comment

how to move master changes to branch

git checkout -b newfeat master
git rebase --onto working-branch origin/master newfeat
git checkout master
git reset --hard origin/master

At this point you have:
*master pointing to the last pushed commit (origin/master)
*working-branch never changed
*a new newfeat branch that contains all the new commits and is ahead of working-branch.

Comment

PREVIOUS NEXT
Code Example
Shell :: find pip install directory 
Shell :: link an existing local git to remote repo 
Shell :: permission exec linux 
Shell :: how to stop docker 
Shell :: how to upgrade react in cra 
Shell :: where is docker images stored windows wsl2 
Shell :: install adonis cli 
Shell :: reverse string in shell script 
Shell :: string to array bash 
Shell :: adb uninstall apk 
Shell :: stop all docker containers 
Shell :: gitlab set global username and password 
Shell :: install docker wsl 
Shell :: git untrack 
Shell :: git push existing repository 
Shell :: bash find full path 
Shell :: shell method 
Shell :: pacman reinstall 
Shell :: install ruby 
Shell :: ubuntu terminal network monitor 
Shell :: disable aslr 
Shell :: debian install postgresql 
Shell :: install nvidia cuda toolkit ubuntu 20.04 
Shell :: What command do you use to pull any changes from the master repository into your local repository? 
Shell :: how to change my git default editor to vs code 
Shell :: change remote origin to fork 
Shell :: yarn add @materialui 
Shell :: gitignore tracked files 
Shell :: how to check the parent branch in git 
Shell :: pip installation directory 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =