Merge (without branch) into master

dave@dave-dev:/media/dev/belgravia$ git branch * (no branch) master 

I am not sure how this happened, but is there a way by which I can merge a non-branch into a master. I'm not sure how I can merge two branches when one of them is not a branch. Non-branch captures seem to be free. I am afraid that checkout master will result in data loss.

+45
git version-control
Jan 13 2018-11-11T00:
source share
3 answers

Use git show to get the SHA1 commit id of the current HEAD. With this information, you cannot lose these commits.

Then switch to the wizard and:

 git merge abc123 

where abc123 is SHA1 from the first step.

+68
Jan 13 2018-11-11T00:
source share
β€” -

Perhaps you can commit it to the current branch (without branching)

Then you need to do:

 git reflog 

After that, you can get the identifier of this commit as 1d84d08

do:

 git checkout master git merge 1d84d08 
+4
Aug 25 '12 at 4:40
source share

The reason why you (without a branch) you did:

 git checkout REMOTE_BRANCH_NAME 
  • So that you can work locally on this branch, you need to do: git checkout -b local_branch_new_name
  • now do a: git branch - a
  • you will see:

local_branch_new_name

  master 
  • From here, you can combine the branch into a master in the usual way. switch to the wizard and do:

    git merge local_branch_new_name

+3
Aug 15 2018-12-18T00:
source share



All Articles