Wednesday, September 24, 2014

Push or Commit code to BitBucket Repository Using Git

Leave a Comment
This tutorial list all the steps to push the code from your local directory to BitBucket using git bash. Before committing you first clone BitBucket Repository on Local System

Steps to Push or Commit code First Time to BitBucket using Git Bash from Local System:

Step 1: After cloning git repository add a new file to it as shown in diagram below:

Git Repo push

Step 2: Now open Git Bash UI and then change to the directory which you have cloned on the system using cd command as shown below:

cd command in git bash

Step 3: Use git init command to initialize the directory as shown in the diagram below:

git init command

Step 4: Login to your bit bucket account . Open the repository and then expand the command line I have an existing project or I am starting from scratch and then copy the command as shown in the picture below:

command line in bit bucket

Step 5: Right click on git bash and then paste as shown in diagram below:

how to paste in git bash

Step 6: To add the file for commit use command git add * as shown in diagram below:

git add command

Step 7: To check which files are added to commit write command git status as shown below . It will show the file name for commit.

git status

Step 8: Now execute command git commit -m "your comment" as shown below:

git commit

Step 9: Finally write command git push origin master as shown below and then git will ask for your bit bucket account password as shown below:

git push origin master

Git will take some time to push code to bit bucket.

Login to your bit bucket account and then open the repository click on Commits in left to check your commit as shown below in the diagram:

check commit in git bash


Post a Comment