Learn Working with Git and Bitbucket
In this article, I will explain to you how to work with git and bitbucket. This is a direct practice example for the beginner
Before starting let’s clear what is git and bitbucket, for this please read below some of the best articles
Step: 1 Download Git and install
Download Git https://git-scm.com/download and then install.
No need check anything on installation process just click next on hole process.
Step: 2 Create an account at Bitbucket
Create an account at https://bitbucket.org
Step: 3 Run Git Bash
Step: 4 Git setup command (Only first time of git setup)
- git config –global user.name “Name” g (git config –global user.name “yuvrajkhavad”)
- git config –global user.email “your email id” g (git config –global user.email “email@example.com”)
- Press enter without entering any file name.
- Enter the two-time password then display newly generated file path. (Note: This password will use for clone project, push project and pull project).
- Open file folder mention in git bash and copy the key from that locations
- Then add a key in Bitbucket
- Login to Bitbucket.
- Go to View Profile
- Click on SSH keys and then Add key.
- Paste the key into the text box:
- Click Add key. You’re done!
- Then create a new project repository and copy project url becuase we have to use at setp 5.1
Step: 5 then move the folder to the location where you have to clone project
- cd c: (Note: Move in C directory)
- cd test/ (Note: Move to a particular folder of your project)
Step: 5 Clone (copy) project in local computer (Only first time of start new project)
- git clone <git repo url> e. g (git clone firstname.lastname@example.org:zindexsolutions/test.git)
- Then type “Yes”
- Then enter your password
Step: 6 Regular Commands
- git status
- git add . / -A g (git add .)
- git commit -m “<commit message>” g (git commit -m “First Commit”)
- git push origin <branch name> g (git push origin master) It will uplod files local to bitbucket account
- git pull origin <branch name> g (git push origin master) It will copy files bitbucket to local
It’s done. Let me know have any problem happy to help. Just sent mail at email@example.com.