How to Switch GitHub or Bitbucket account

If you are using two GitHub / Bitbucket Account in single system. Then you will get 403 error while pushing your code to your online repository.

Go to Setting.

Credential Manager.

Windows Credential.

Generic Credential.

Edit your GitHub or Bitbucket Details or Remove and Add new details.

Some Useful Git Command

To add file: git add filename

To Commit: git commit

To Check the status: git status

To Save you change (back to last commit): git reset HEAD^ --soft

To Discard changes (back to last commit): git reset HEAD^ --hard

To reset to the last commit: git reset --soft HEAD~

To stash all the changes in the working tree: git stash

To get your changes back: git stash pop

To remove the specified files from the next commit: git reset HEAD

Quick setup to Push you code on Github or BitBucket

Using HTTP

To clone you Repository:

git clone https://github.com/username/repository_name.git

To create a new repository on the command line:

echo "# Comment" >> README.md

git init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/username/repository_name.git

git push -u origin master

To Push an existing repository from the command line:

git remote add origin https://github.com/username/repository_name.git

git push -u origin master

GitHub – tilakrj

Tilak Raj

I am working as a software engineer.