Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to add new origin in git


below is used to a add a new remote:

git remote add origin git@github.com:User/UserRepo.git
below is used to change the url of an existing remote repository:

git remote set-url origin git@github.com:User/UserRepo.git
below will push your code to the master branch of the remote repository defined with origin and -u let you point your current local branch to the remote master branch:

git push -u origin master
Comment

adding remote origin git

git remote add origin <link>
Comment

git add origin command

# To add origin
$ git remote add origin <github repo link>
Comment

git remote add origin

git remote add origin https://github.com/example/Git-CheatSheet.git
Comment

git add new origin

git remote add new-origin git@github.com:manakor/manascope.git
Comment

git remote add origin

--::-- Using SSH --::--
#### Create SSH key ####
$ ssh-keygen -t ed25519 -C "<YourEmail>@<Domain>.com"

#### Copy the SSH key ####
$ cat /path/to/private_key_file.pub

#### Add the SSH key to your GitHub account ####

$ echo "# myPracticeRepo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git config core.sshCommand 'ssh -i /path/to/private_key_file'
$ git remote add origin git@github.com:<UserName>/<RepoName>.git
$ git push -u origin main


--::-- Using HTML --::--
$ echo "# myPracticeRepo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin https://github.com/<UserName>/<RepoName>.git
$ git push -u origin main
Comment

add local origing git

$ git init --bare ~/repos/myproject.git
$ cd /path/to/existing/repo
$ git remote add origin ~/repos/myproject.git
$ git push origin master
Comment

git add new origin

git remote rename new-origin origin
Comment

git add new origin

git push --all new-origin 
git push --tags new-origin
Comment

PREVIOUS NEXT
Code Example
Shell :: yarn install raspberry pi 
Shell :: store credential cache git 
Shell :: how to revert to last git commit 
Shell :: delete file linux terminal 
Shell :: installation of genymotion on ubuntu 
Shell :: powershell suppress error 
Shell :: git unstage file from add 
Shell :: wordpress update core and plugins cli 
Shell :: repository commands 
Shell :: run ionic live 
Shell :: como atualizar a versão do angular 
Shell :: git command to create a branch from another branch 
Shell :: npm dotenv 
Shell :: Recover accidentally deleted files by git reset hard 
Shell :: update path variable mac 
Shell :: clone specific branch git 
Shell :: how to run shell script 
Shell :: push an existing repository 
Shell :: electron app any website 
Shell :: install rclone FOR UBUNTU 
Shell :: bash count lines 
Shell :: linux show all group members 
Shell :: apple logo in terminal 
Shell :: how to unzip using tar 
Shell :: xrandr 1366 
Shell :: how to port-forward k8s on server 
Shell :: Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted 
Shell :: bash count elements in string 
Shell :: how to remove amplify from system globally 
Shell :: @material-ui/icons 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =