yauwana ravindra
yauwana ravindra

Reputation: 19

git master cannot merge branch

I'm new to git and I have created a branch (b1) from master

but the issue is, in the b1 branch has the codes I need and I need to merge those codes to master.but when i checkout to the master and try to merge the the b1 branch in to the master it says already updated.but that is not true. any suggestion

Upvotes: 0

Views: 12522

Answers (2)

geo
geo

Reputation: 2433

The way you should work is this :

  1. git checkout -b 'yourBranch'
  2. make changes to your branch
  3. git add . (to add your changes)
  4. git commit -m "Your message on commit"
  5. git push origin 'yourBranch' (if there is a remote repo)
  6. git checkout master (to return on the master repo)
  7. git merge 'yourBranch'

Also, you can have a nice look here git-basic

Upvotes: 1

farbgeist
farbgeist

Reputation: 101

Make sure you are on master:

git branch 

=> * should be next to master

if not:

git checkout master

Check if everything in master is commited:

git status

If not everything is commited: - git add . - git commit -m 'added missing files' - optional: git push

Delete old branch to be clean:

git branch -d b1

Make a new branch:

git branch b1

Switch to new branch:

git checkout b1

Now everything should be as desired ;-)

Upvotes: 2

Related Questions