Updating git credential from Windows 10
- Need to go to Control Panel → Credential Manager → Windows Credentials.
- Need to find the credential related to my git accounts to edit or remove those.
Here is the link for more information on this https://cmatskas.com/how-to-update-your-git-credentials-on-windows/
Setting up Identity
git config user.email "mahfoozur.rahman.bd@gmail.com"
git config user.name "Md Mahfoozur Rahman"
Connecting local repo with live repo
git remote add origin some-url
Changing link to current repo
git remote set-url origin some-url
To see all local branches
git branch
To see all remote branches
git branch -r
Git Remove local branch
git branch -D local-branch-name
Git remove remote branch
git push origin --delete remote-branch-name
Git switch to new created branch
git checkout -b branch-name
Git switch to created branch
git checkout branch-name
Git checkout and track remote branch
git checkout --track origin/branch-name
Setting up ssh key for password less remote git push pull
cd ~/.ssh
ssh-keygen -t rsa -C 'mahfoozur.rahman.bd@gmail.com'
then press enter three times ( private and public identification will be saved )
less id_rsa.pub ( to copy content from id_rsa.pub and mouse drag select to copy with ctrl+c )
add this key going to github/bitbucket under ssh key section
git remote set-url origin git@bitbucket.org:user_name/repo_name.git
git remote -v ( to see list of all remote repos starting with git instead of https )
To set tracking information for branch without mentioning branch name at the time of remote push pull
git branch --set-upstream-to=origin/branch_name master
To check remote url of a branch
git remote show origin