It is quite simple. Follow this link to install and setup GIT:
Do not create a new repository in BitBucket, as we already have couple of repositories. Do your operations on any of the two existing repositories.
How to use the GIT UI:
After cloning ‘web-app’ repository I get the ‘web-app’ folder on my machine. Initially it is empty since there is no source code. I added a file ‘Read Me.txt’
If I right-click on the file and select ‘Git GUI’. It will prompt me to select between ‘Creating a new repository’, ‘Importing/Cloning a new repository’, ‘Opening an existing repository’.
Since we already have a repository created, select ‘Opening an existing repository’. Give the directory of ‘web-app’ folder (the folder which contains .git file).
In GIT, checkin is a 2-step process: We need to add file to staging area and then add to commit.
Select the ‘Read Me.txt’:
Select Commit->Stage to Commit:
Give a commit message:
This will commit the file to local repository. But you have to ensure that these changes are pushed to our BitBucket repository also.
Click on ‘Push’. New popup will open showing all the branches in the remote repository. Currently we have only one branch: master.
Click on Push. It will ask for your BitBucket account password. If everything goes fine, you should get success message.
Go to BitBucket repository. Click on Commit or Source and you should see new file added/updated.
How to Remove a checked in file:
I don’t know how to do this using GIT GUI. So if you have to do it, you can use GIT bash.
Open GIT bash.
Navigate to file path.
Give these commands:
git rm file1.txt
git commit -m "remove file1.txt"
git push -u origin master
This will remove the file from local as well as remote repository.
Comments