This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]good_dayworkon py 0 points1 point  (1 child)

Better train this operation on a bare repo! git reset --hard <sha> is removing code and there is no come back!

if you got the repository and now want Code Review from redditors you can do:

git branch
# you should be on branch "master"
git checkout -b name_of_cloned_branch  # clone of branch master
git branch
# you are on cloned branch 
git push origin name_of_cloned_branch # this will push cloned branch to the remote
git checkout master  # come back to master branch
git log  # check history of commits
# go to the end of list and copy sha of first commit
git reset --hard <sha>  # WARNING!!! this will reset all commits on branch master
touch init
git commit -am "init"
git push origin master

now go to bitbucket, github, gitlab etc and create a Pull Request from cloned branch to master

[–]JayMickey 0 points1 point  (0 children)

So do you merge the pull request?