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

Answer by Javier C. for How do I push a new local branch to a remote Git...

You can do it in 2 steeps: 1. Use the checkout for create the local branch: git checkout -b yourBranchName Work with your Branch as you want. 2. Use the push command to autocreate the branch and send...

View Article



Answer by Brad Parks for How do I push a new local branch to a remote Git...

Building slightly upon the answers here, I've wrapped this process up as a simple Bash script, which could of course be used as a Git alias as well. The important addition to me is that this prompts me...

View Article

Answer by Arda for How do I push a new local branch to a remote Git...

I simply do git push -u origin localBranch:remoteBranchToBeCreated over an already cloned project. Git creates a new branch named remoteBranchToBeCreated under my commits I did in localBranch. Edit:...

View Article

Answer by Fadid for How do I push a new local branch to a remote Git...

For GitLab version prior to 1.7, use: git checkout -b name_branch (name_branch, ex: master) To push it to the remote repository, do: git push -u origin name_new_branch (name_new_branch, example: feature)

View Article

Image may be NSFW.
Clik here to view.

Answer by bg17aw for How do I push a new local branch to a remote Git...

A slight variation of the solutions already given here: Create a local branch based on some other (remote or local) branch: git checkout -b branchname Push the local branch to the remote repository...

View Article


Answer by Thuy Trinh for How do I push a new local branch to a remote Git...

I made an alias so that whenever I create a new branch, it will push and track the remote branch accordingly. I put following chunk into the .bash_profile file: # Create a new branch, push to origin...

View Article

Answer by shankar kumar for How do I push a new local branch to a remote Git...

To upload your local branch of a public repository, you need to cd to the public repository and then use the following code: git push -u origin branchname

View Article

Answer by cptjack for How do I push a new local branch to a remote Git...

To create a new branch by branching off from an existing branch git checkout -b <new_branch> and then push this new branch to repository using git push -u origin <new_branch> This creates...

View Article


Answer by piyushmandovra for How do I push a new local branch to a remote Git...

Simply put, to create a new local branch, do: git branch <branch-name> To push it to the remote repository, do: git push -u origin <branch-name>

View Article


Answer by ErichBSchulz for How do I push a new local branch to a remote Git...

If you are not sharing your repo with others, this is useful to push all your branches to the remote, and --set-upstream tracking correctly for you: git push --all -u (Not exactly what the OP was...

View Article

Answer by Daniel Ruoso for How do I push a new local branch to a remote Git...

In Git 1.7.0 and later, you can checkout a new branch: git checkout -b <branch> Edit files, add and commit. Then push with the -u (short for --set-upstream) option: git push -u origin...

View Article

Answer by VP. for How do I push a new local branch to a remote Git repository...

I suppose that you have already cloned a project like: git clone http://github.com/myproject.git Then in your local copy, create a new branch and check it out: git checkout -b <newbranch>...

View Article

Answer by Tobias Kienzler for How do I push a new local branch to a remote...

edit Outdated, just use git push -u origin $BRANCHNAME Use git publish-branch from William's miscellaneous Git tools (gitorious repo and clone). OK, no Ruby, so - ignoring the safeguards! - take the...

View Article


Answer by Lohrun for How do I push a new local branch to a remote Git...

Prior to the introduction of git push -u, there was no git push option to obtain what you desire. You had to add new configuration statements. If you create a new branch using: $ git checkout -b...

View Article

How do I push a new local branch to a remote Git repository and track it too?

I want to be able to do the following: Create a local branch based on some other (remote or local) branch (via git branch or git checkout -b) Push the local branch to the remote repository (publish),...

View Article


Answer by shasi kanth for How do I push a new local branch to a remote Git...

To push a new local git repository to remote git repository:Create a git repository on githubFrom your local repository, do: git initgit remote add origin <YOUR_GIT_REPO>git push -u origin master

View Article

Answer by Eugene Yarmash for How do I push a new local branch to a remote Git...

For greatest flexibility, you could use a custom Git command. For example, create the following Python script somewhere in your $PATH under the name git-publish and make it executable:#!/usr/bin/env...

View Article


Answer by Neeraj Bansal for How do I push a new local branch to a remote Git...

Create a branch on the remote.After creating, following command will sync your local repo with remotegit pull origin mastercheckout to new branchUpdate your code and commit.just do git push

View Article

Answer by Devin G Rhode for How do I push a new local branch to a remote Git...

I think this is the simplest alias, add to your ~/.gitconfig[alias] publish-branch = !git push -u origin $(git rev-parse --abbrev-ref HEAD)You just rungit publish-branchand... it publishes the branch

View Article

Answer by Ashwani Panwar for How do I push a new local branch to a remote Git...

git push --set-upstream origin <your branch name>

View Article
Browsing all 22 articles
Browse latest View live




Latest Images