This is a basic newbie question about Git
and GitHub
. I just want to make sure I'm doing it right.
I have a local Git
as well as a GitHub
repo for my ReactNative
project. I have Master
and Develop
branches and in order to test out native-base
UI library, I created a new branch named NativeBase
. I now want to merge
the NativeBase
branch back into Develop
both locally and on GitHub.
以下是正确的步骤吗?
- I make sure I'm on
Develop
branch by issuinggit checkout develop
in my terminal - Then issuing
git merge nativebase
will merge theNativeBase
intoDevelop
- I think the next step is to get the updated
Develop
ontoGitHub
by issuinggit push -u origin develop
One thing I'm not clear about is what happens to the NativeBase
branch on GitHub
. I think Step 2 here will remove the NativeBase
branch locally because it's now merged into Develop
. Is that correct?
Also, is this how I need to update/merge GitHub
repos after a merge
locally?
This is not true although all the info and history of the branch are now in the
Develop
branch. You have to delete the NativeBase branch.-d
is safe and recommended because it will make sure that all the commits fromNativeBase
are moved to theDevelop
branch before deletion.除非您明确地做某事,否则什么也不会做。如果您还希望删除GitHub上的分支,则必须强制删除它。