Wednesday, 29 July 2020

How to Move a Private Repository from Bitbucket to Github


$ git clone https://USER@bitbucket.org/USER/PROJECT.git
$ cd PROJECT
$ git remote add upstream https://github.com:USER/PROJECT.git
$ git push upstream master
$ git push --tags upstream


Tuesday, 28 April 2020

How to discard local changes and pull latest from Git repository

Sometimes we want to pull latest code from Git repository and ignore all changes in locales.

Run the below commands (or you can see directly on web interface git repo you used)

git log

From this you will get your last push commit hash key

Or you can

git reset --hard <your commit hash key>