Reputation: 19
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
Reputation: 2433
The way you should work is this :
git checkout -b 'yourBranch'
make changes to your branch
git add . (to add your changes)
git commit -m "Your message on commit"
git push origin 'yourBranch' (if there is a remote repo)
git checkout master (to return on the master repo)
git merge 'yourBranch'
Also, you can have a nice look here git-basic
Upvotes: 1
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