Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #git #push #local #branch #existing #remote
ADD COMMENT
Topic
Name
8+5 =