Setup source code of Visual studio on Bitbucket
Setup source code of Visual studio on Bitbucket
Prerequisites:
Download and install
bitbucket extension for Visual studio
from following URL
Download the following software for command-line access of Bitbucket
1. In the file menu,
go to the source control options and clear the bindings. You'll specifically
want File - Source Control - Advanced - Change Source Control...
2.
You will see the screen as bellow
3. Now one by one
remove connect checkboxes by clicking
the unbind button in the top toolbar and at the
end press ok.
4. To tools--> options-->Source Control
change current source control plug-in to as following ( GIT).
5. Now right click on
solution and press Add to Source control
this will add your solution to the local repository and create one with a solution
name.
6. Once you do above you need to go to team explorer and click on the local git repository in my case its “Digibanc-MiddlewareAdmin”.
Double click on this.
1 7. Following screen
will appear
1 8. Press sync
and which will take you following
screen.
9. Now press the
publish git Repo this will show a text
box says “Enter the URL of an empty Git repo”.
10. Repo URL you will
get from Bitbucket on repo home page as
following. Copy this URL and past in VS publish git repo URL
1 11. This will give an error, to resolve and sync
repo first time only you have to go to
the solution folder and open Git Bash here Command line and run “git push -f origin master”. this will push code to the repo.
12. Now
try to add a new file in your project and try to commit it by pressing Team Explorerè Home a Changes, this will show you all the changes in
your project.
13. Now
add comments as comments are mandatory in Bitbucket, and press commit All and
Sync, after then press push on the same screen. This will push new changes to the repo.
See
two comments one for adding project files and others for adding new file into
repo project.
Some useful commands.
If you want to delete a folder from the repo and not from the local machine
then use this “git rm -r --cached Digibanc-MiddlewareAdmin”
Additional Information :
Fetch just downloads the objects and refs from a remote repository and normally updates the remote-tracking branches. Pull, however, will not only download the changes but also merges them.
Additional Information :
Fetch just downloads the objects and refs from a remote repository and normally updates the remote-tracking branches. Pull, however, will not only download the changes but also merges them.
Comments
Post a Comment