Mastering Git
Table of Contents
1 Introduction
Git is one of the most important and key skill that we have to acquire especially for software development. I am an Atlassian Consultant which is my main job. I help companies and teams get the most out Atlassian tools like Jira, Confluence, Bitbucket and help them deliver fast and efficiently. I often work with development teams and they use Git as their version control system.
2 Branching
Create a branch and switch to it.
git checkout -b <branch-name>
Create a branch without switching and switch to it later.
git branch <branch-name> git checkout <branch-name>
Go back to your branch.
git branch main
Check your branches.
git branch
3 Errors
3.1 Can't git push to Bitbucket: Unauthorized - fatal: Could not read from remote repository
Remove the SSH key from the repo. (Click on repo name > Settings > Access Keys) Add SSH key to Account settings SSH keys. (Click on your avatar > Personal Settings > SSH Keys)
Change .git/config
to use ssh instead of https.
Replace this url.
url = https://sparxsys@bitbucket.org/sparxsys-team/ravisagar_new_site.git
with this url
url = git@bitbucket.org:sparxsys-team/ravisagar_new_site.git