Sampath
Sampath

Reputation: 65890

Merge 2 GIT Branches

I have a GIT requirement like this.

  1. Need to create a Branch from a project which is not in the GIT right now : B1

Note : When I try to do this using TortoiseGit it gives this : fatal not a valid object name : 'HEAD'

  1. Then I need to create an another Branch from the Master branch : B2

Note : I have done this task.

  1. After that I need to merge Branch B1 to B2

Could you tell me how can I do this ? I'm not familiar with the GIT commands.My favourite Tool is TortoiseGit Windows utility.Thanks.

Upvotes: 0

Views: 55

Answers (1)

Peter Badida
Peter Badida

Reputation: 12189

Your steps are not well ordered, therefore we'd start with the easiest:

  • create a branch from your master branch
  • then create another branch in which you'll do some stuff with files - if it's something totally new, just delete everything and replace with your code, otherwise only add new stuff
  • and in the end merge these branches

The way you described is really weird way how to merge things. Use some recommended steps on git/github or search "merge" here. When you see something with 500+ upvotes, you know you're there. :)

Upvotes: 2

Related Questions