Change branch in git

 Change branch in git

git checkout -b branchName

eg.

git checkout -b main

----------------------------------------------------

git force push code

git push -f yourBranchName

-----------------------------------------------------

git pull code into repository without authentication for this go to account setting.




After that click to developer settings like below image


Now click to Token (classic)




Click to Generate new token






write note and checked checkbox like below image after that click to generate token button and copy that token for push any repository


git push https://yourtoken@github.com/username/yourrepo.git


Comments