Quantcast
Channel: How do I push a new local branch to a remote Git repository and track it too? - Stack Overflow
Viewing all articles
Browse latest Browse all 22

Answer by Hitesh Sahu for How do I push a new local branch to a remote Git repository and track it too?

$
0
0

Complete Git work flow for pushing local changes to anew feature branch looks like this

Pull all remote branches

git pull --all

List all branches now

git branch -a  

Checkout or create branch(replace <feature branch> with your branch name):

git checkout -b <feature branch>

shows current branch. Must show with * In front of it

git branch      

Add your local changes (. is on purpose here)

git add .

Now commit your changes:

git commit -m "Refactored/ Added Feature XYZ"

Important: Take update from master:

git pull origin feature-branch

Now push your local changes:

git push origin feature-branch

Viewing all articles
Browse latest Browse all 22

Latest Images

Trending Articles





Latest Images