Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

github add new origin

git init .
git remote add origin <http/someURL>
git pull origin master
Comment

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 :: install kubectl ubuntu 
Shell :: multiple ssh key 
Shell :: github oauth 2 
Shell :: user no login centos 
Shell :: git id 
Shell :: cmd refresh path 
Shell :: bash switch 
Shell :: how to see (and kill) what is running on your port +mac 
Shell :: read cpu temperature ubuntu 
Shell :: docker setup 
Shell :: git add ignored file 
Shell :: install google assistant on linux 
Shell :: redis client find key 
Shell :: copy from remote server 
Shell :: git publish git branch 
Shell :: take sudo access inside vim 
Shell :: check port running 
Shell :: instal maven in mac brew 
Shell :: check openvpn working 
Shell :: bash variable execute 
Shell :: bash store pipe output in variable 
Shell :: linux command to open a file 
Shell :: enable system virtualization cmd 
Shell :: command to Change User Primary Group 
Shell :: change default branch on git 
Shell :: git stash stack overflow 
Shell :: debian EXPKEYSIG 
Shell :: linux how to write to file 
Shell :: kivy vim plugin 
Shell :: linux unity reinstall 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =