Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git push to existing repo

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 #existing #repo
ADD COMMENT
Topic
Name
6+2 =