You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# remove the remote to the original repo
git remote remove origin
# add a remote to the new repo
git remote add origin <my_repo_url>
# push to master
git push origin master
Long Approach
# add the old repo as a remote repository
git remote add oldrepo https://github.com/path/to/oldrepo
# get the old repo commits
git remote update
# examine the whole tree
git log --all --oneline --graph --decorate
# 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
# check your local repo is correct
git log
# send your new tree (repo state) to github
git push origin master
# remove the now-unneeded reference to oldrepo
git remote remove oldrepo
Force push your new repo state & synchronize collaborators
# Force push to the repo
git push -f origin master
# make sure there are no unsaved changes
git status
# pull the latest version from github
git fetch
# move their master branch pointer to the one you published to github.
git reset --hard origin/master
I have a repo from a github classroom that i want to move to my personal account to continue working on, does the short approach just work? or do i also need to do the Update and rebase your local copy and Force push your new repo state & synchronize collaborators?
The repo is only acessable to my school account now, i did commit with my personal account to it. so i dont know if all the commits will be correctly linked to me
I guess this line should be
git push origin master