/
Git commands to sync repo

Git commands to sync repo

  1. To Add the old repo as a remote repository:

git remote add oldrepo https://github.com/path/to/oldrepo

2. To Get the old repo commits

git remote update

3. To examine the whole tree

git log --all --oneline --graph --decorate

4. To copy (cherry-pick) the commits from the old repo into your new local one

git cherry-pick sha-of-commit-one git cherry-pick sha-of-commit-two git cherry-pick sha-of-commit-three

5. check your local repo is correct

git log

6. send your new tree (repo state) to github

git push origin master

7. remove the now-unneeded reference to oldrepo

git remote remove oldrepo

Video reference:

https://tldv.io/app/meetings/636b71e65b26aa0013ee7c9c

Related content