GIT Setup Guide

Please follow below steps for a happy GIT Setup(Bitbucket).

Step 1: Create a folder in C: or D: drive

Goto C: drive
Create a folder: Folder name – Name
C:\Name

Step 2: Clone master branch

Open GIT Bash Here
Execute commands:
git init
git clone https://bitbucket.org/repo/src/master/

Step 3: Create and checkout your branch

Goto D:\Folder
Open GIT Bash Here
Execute commands:
git branch name (Example: new_branch)
Note: If branch already exists, skip above command
git checkout new_branch

Step 4: Pull code from a branch

Execute command:
git pull origin main

Your code is all set to be used!

GIT Commit Guide

Step 1: Check for the files that are changed

git status

Step 2: Add the files that are changed

To add all the files, execute:
git add .
To add specific file mention file name after add:
git add filename

Step 3: Commit the changes to your branch

git commit -m "add a comment here"
Example:
git commit -m "new commit"

Step 4: Pull changes from main branch - To make sure everyting is in sync

git pull origin main

Step 5: Resolve Conflicts if any in IDE

Step 6: Push the changes to your branch

git push origin branch_name

Git User Change

Step 1: Edit the user details

git config --global --edit
Press Insert Key
Modify the incorrect user details with correct details
Press Esc
Type :wq
Press Enter

Step 2: Fix identity of commit

git commit --amend --reset-author

Step 3: Git Uncommit

git reset --soft HEAD^

Step 4: Git Configurations

git config --list

Step 5: Git Restore

git restore .

Set remote URL

git remote set-url origin git@github.com:username/repository.git

Git Tutorial

Go through below tutorial for any queries:
https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud