-2

I have Branch A(Where I am coding),I have Identified the branch that I created(branch A)from GitBash was not appearing on GitHub Repo. Steps Done:

git clone url@git.com
git checkout -b branchA

Now Want to take master piece into another branch from git.

git clone url@git.com
git checkout branchB ( I have created on Github)

Now Wanna Merge Branch A into Branch B and make Branch B Active...? Share me some best commands or How to merger locally with out loosing my code and getting conflicts..

Thank you Folks. JB

kowsky
  • 12,647
  • 2
  • 28
  • 41

2 Answers2

0

Firstly try to identify the difference using git diff FIRST-BRANCH..SECOND-BRANCH

I think this will work for your situation

git chechout branchA
git add .
git commit -m "msg"
git pull
git push origin branchB
git checkout branchB

I suggest you to make a backup of your repository to be secure

Dhruv Agarwal
  • 558
  • 6
  • 15
0

If your branch is not showing in your hub probably you have not pushed it yet

git checkout branch -B
git add . 
git commit -m "message"
git push origin branch -B

if you want to merge two branches

git checkout "Branch in which you want to add"
git merge "Branch which you want to add"
git push origin "branch name"

now you will see all the commits in that branch on the Github

Ashish Rawat
  • 90
  • 1
  • 8