gitgit-branchgit-repo

How do I push changes I made in a branch into the master branch?


There is no remote repository.

There only exist one repository on my local machine.

So here is what I did:

git branch new-branch
git checkout new-branch

//implemented some changes

//now wants to push changes to master
//what is the command?

Solution

  • As I Understand, what you are trying to do is "merge" your branch with master. so try the following.

    git branch new-branch
    git checkout new-branch
    
    //implemented some changes
    
    //to push chages to master first checkout to master
    git checkout master
    git merge new-branch