1. git
  2. github
  3. gitlab

Deploy to github and gitlab from same local project

This is to say you want to be able to deploy to multiple remote repositories if that’s the case

To add new repo’s run this command

git remote add < shortname > < url >

 git remote add origin-new [email protected]:username/repo-name.git

where:

  • origin-new is the remote server name (it can be any valid string)
  • [email protected]:username/repo-name.git is the url to your online repo

To Show Your Remotes

$ git remote -v

origin  https://gitlab.com/username/repo-name (fetch)
origin  https://gitlab.com/username/repo-name (push)

origin-new  https://github.com/username/repo-name (fetch)
origin-new  https://github.com/username/repo-name (push)

Pushing to Your Remotes

git push < remote > < branch >

$ git push origin master

$ git push origin-new dev

Fetching and Pulling from Your Remotes

git pull < remote >

git fetch < remote >

$ git pull origin

$ git pull origin-new

for more checkout out Git Basics Working with Remotes

https://rdevs.xyz
Do you like Ashiqur Rahman's articles? Follow on social!
Comments to: Deploy to github and gitlab from same local project

Your email address will not be published.

Attach images - Only PNG, JPG, JPEG and GIF are supported.

Login

Welcome to rDevs

Brief and amiable onboarding is the first thing a new user sees in the theme.
Join rDevs

start writing