I am using Bitbucket
as my Remote repository. My IDE is VS Code. I am now developing flutter projects.
Can someone please explain me, step by step, how I can push and pull code from VS Code to BitBucket?
I have installed their plugin and all, but I can't figure out how. Every online tutorial, including Atlassian official, seems to be confusing and half baked.
I am on Mac. Git is installed as a part of Flutter installation process.
Create a new repository in bitbucket
Clone this in new project in VSC - folder is created automatically You will need to insert the remote repository, something like https://[email protected]/myname/guestbook.git
Make changes. Or copy an existing project, but leave the .git directory unchanged!
Commit
push
I've been wondering the same and spent most of the day trying!!!
I've managed to do part of it in the end. Definitely not the "best practice" approach but might help you get started (if you're on Windows).
First follow the steps here in terms of setting up SSH Keys in VS Code/BitBucket . Definitely a pre-requisite for VS Code to recognize your SSH Keys connected to your BitBucket account
Then, Install the Bitbucket and JIRA Extension:
Then...
1- Create your empty repro in Bitbucket. Copy both the SSH and HTTPS Clone Git instruction (click on the CLONE button on the right-hand side when you're on the "Source" folder in Bitbucket Cloud).
2- Select the Terminal tab in VS Code (View -> Output/Terminal). Navigate to the directory under which you want to create your repo locally (do not create a folder for your repo that will be creates automatically) and paste your GIT clone instruction => It should work and clone your (empty project). If it fails for some SSH Keys, use the HTPPS Clone instruction.
Milestone 1: At this stage an empty folder with the name of your repo should be created and have the .git subfolder.
From there you can...
1) code away
2) use the "Source Control" menu on the left hand-side of VS code navigation bar to see files pending and commit your changes
I got stuck at the "push" part trying to use the Source Control menus. Kept getting an error about origin.
As I'm really useless with GIT I reverted to SourceTree to push my changes. But at least all the basic qork in VS code and finally get all my code in the repo on BitBucket cloud. I'm sure there is a git command to set the origin using the terminal but don't have patience.
I hope it helps you get started. I had a nightmare with it today!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With