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
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 ;-)
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.