Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git new branch push to remote

git push -u origin <branch>
Comment

Push a New Branch To Remote Repository in git command

git push -u origin new_branch
Comment

git push local branch to existing remote

git init
# Optional: create branch
git checkout -b branch_name
git add .
git commit -m "Adds existing project to GitHub remote repository"

git remote add origin https://github.com/username/example-project.git

git pull --rebase origin main
# Resolve merge conflicts if needed
git push origin main
Comment

github Push local branch to Remote

git push origin <Branch_Name>
Comment

git push local branch to remote repo

$ git checkout feature
$ git push -u origin feature
Comment

Push your branch up to the remote.

$ git push <remote> <branch>
Comment

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

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 branchB
$ git push origin branchB:branchB
You can use the git config command to avoid editing directly the .git/config file:

$ git config branch.branchB.remote origin
$ git config branch.branchB.merge refs/heads/branchB
Or you can edit manually the .git/config file to add tracking information to this branch:

[branch "branchB"]
    remote = origin
    merge = refs/heads/branchB
Comment

PREVIOUS NEXT
Code Example
Shell :: apt install mp3 diags 
Shell :: print all installed program with scoop 
Shell :: left navbar not showing in ubuntu 
Shell :: more wsl2 images 
Shell :: hora terminal 
Shell :: centos locale pg_config path 
Shell :: start a new shell to examine the situation 
Shell :: http 192.168.l.l admin airtel 
Shell :: asterisk agi script no such file or directory 
Shell :: dgram i node 
Shell :: view git pull changes terminal 
Shell :: command to check the status of a system service 
Shell :: close all open windows macos 
Shell :: navigate to previous directory (DIR) 
Shell :: Command to install parse-url module 
Shell :: install sanity with free boosted plan - sanity.io -sonny 
Shell :: diff between tail and head command 
Shell :: search in github repo 
Shell :: umount device is busy 
Shell :: GImp install ubuntu terminal command 
Shell :: delete github branch 
Shell :: ssh ubuntu version check 
Shell :: rename directory from command line 
Shell :: how to push existing git repository 
Shell :: install ignite-cli 
Shell :: yay see package files 
Shell :: sharegate powershell exclude file type 
Shell :: FATAL module ucvideo not found 
Php :: tinker color disabled 
Php :: is frontpage wordpress 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =