Active reading.
Source Link
Peter Mortensen
  • 30.3k
  • 21
  • 100
  • 124

Rename the branch will be useful once your branch is finished then. Then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in gitGit you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch. ###1. Rename your local branch

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch. ###2. Delete the old-name remote branch and push the new-name local branch

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch. ###3. Reset the upstream branch for the new-name local branch

git push origin -u new-name

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name

Rename the branch will be useful once your branch is finished. Then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in Git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

###1. Rename your local branch

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

###2. Delete the old-name remote branch and push the new-name local branch

git push origin :old-name new-name

###3. Reset the upstream branch for the new-name local branch

git push origin -u new-name
Update code instead of quote
Source Link
trungk18
  • 19.3k
  • 7
  • 44
  • 78

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name

git push origin -u new-name

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name
Update reference
Source Link
trungk18
  • 19.3k
  • 7
  • 44
  • 78

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name

Quoting from nice article

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name

Quoting from nice article

Rename branch will be useful once your branch is finished then new stuff is coming, and you want to develop in the same branch instead of deleting it and create the new one.

From my experience, to rename a local and remote branch in git you should do the following steps.

Quoting from Multiple States - Rename a local and remote branch in git

1. Rename your local branch.

If you are on the branch you want to rename:

git branch -m new-name

If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch.

git push origin -u new-name

Source Link
trungk18
  • 19.3k
  • 7
  • 44
  • 78
Loading