DEV Community

Cover image for Push Two remote GitHub in same time
bappasaha
bappasaha

Posted on

Push Two remote GitHub in same time

নিচের কমান্ড গুলো ফলো করুন :

git init

Enter fullscreen mode Exit fullscreen mode
git add .

Enter fullscreen mode Exit fullscreen mode
git commit -m "First commit"

Enter fullscreen mode Exit fullscreen mode
git branch -M main

Enter fullscreen mode Exit fullscreen mode
git remote add bappasahabapi YOUR_PERSONAL_ACCOUNT_REPOSITORY_HTTPS_URL

ex: `git remote add https://github.com/bappasahabapi1/test1.git`

Enter fullscreen mode Exit fullscreen mode
git remote add bappasahabapi1 YOUR_PERSONAL_ACCOUNT_REPOSITORY_HTTPS_URL
ex: `git remote add https://github.com/bappasahabapi1/test2.git`
Enter fullscreen mode Exit fullscreen mode

First account

git push bappasahabapi1 main

Enter fullscreen mode Exit fullscreen mode

Second account

git push bappasahabapi2 main

Enter fullscreen mode Exit fullscreen mode
  • মনে রাখবেন পুশ করার সময় খেয়াল রাখবেন আপনি কোন ব্রাঞ্চে আছেন আর কোন ব্রাঞ্চে পুশ করতেছে। Git bash Terminal এ দেখতে পারবেন আপনি কোন ব্রাঞ্চে আছেন বর্তমানে। এরকম হলে ব্রাঞ্চ পরিবর্তন করে আবার পুশ করেন।
git branch -M main

Enter fullscreen mode Exit fullscreen mode

এর পরেও না হলে:

  • .git হিডেন ফোল্ডার ডিলিট দিয়ে আবার চেষ্টা করুন।

বিঃ দ্রঃ মনে রাখতে হবে কোনো কিছু পুশ করলে আপনাকে ২টা রিপোজিটরিতে পুশ করতে হবে। Deploy করার পরে গিটে আবার পুশ করলে vercel এ অটো আপডেট হয়ে যাবে।

one command to push two branch

npm run push

{
  "name": "vite-react-bsb",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview",
    "push":"git push -u bappasahabapi1 main && git push -u bappasahabapi2 main",
    **"push":"git push -u vercel main && git push -u code main"**
  },
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^5.0.1",
    "react-toastify": "^10.0.4"
  },
  "devDependencies": {
    "@types/react": "^18.2.43",
    "@types/react-dom": "^18.2.17",
    "@vitejs/plugin-react": "^4.2.1",
    "autoprefixer": "^10.4.16",
    "eslint": "^8.55.0",
    "eslint-plugin-react": "^7.33.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.5",
    "postcss": "^8.4.33",
    "tailwindcss": "^3.4.1",
    "vite": "^5.0.8"
  }
}
Enter fullscreen mode Exit fullscreen mode

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay