Skip to main content

remote ↔ to link local Git Repo to remote Git Repo

aka remote

git remote

to print list of all remote connected Git Repo

git remote add origin _URL

to add remote Git Repo w name of origin at _URL

git remote -v

to print remote Git Repo name & URL

git remote show

to print details for remote Git Repo incl Branch

origin

(default) name for remote Repo

git remote add upstream _URL

to sync local Repo w Upstream Github Repo

References

  1. git remote add origin _URL ↔ to add remote Git Repo w name of origin at _URL

  2. push ↔ to sync local Git Repo to remote

  3. fetch ↔ to download Diff in remote Git Repo

  4. git pull origin master ↔ to download remote Git Repo named origin & merge with local repo named master

  5. git clone _URL newName ↔ to clone remote Repo (at _URL) to local machine & rename to newName

  6. Github Reporemote Repo host on github.com

  7. origin ↔ (default) name for remote Repo

  8. --force ↔ flag to overwrite Commit History on remote Repo

  9. -U ↔ flag to origin to Upstream remote

  10. git remote -v ↔ to print remote Git Repo name & URL

  11. git push --force origin __branch ↔ to push local Commit to remote Repo & FORCE sync to local (discard remote history) 🔥 bad for teamwork!

  12. git push -u origin master ↔ to push local Git Repo Branch at Master to remote Repo

  13. git push --force-with-lease origin __branch ↔ to push local Commit to remote Repo & SAFELY sync (avoid overwrite remote history) ✅ often mandatory to not get fired!