In this article we are going to learn about Version control and publishing content to our website space.
Get started with Bitbucket
Will learn how to create an account in bitbucket , login to account and create repository name
Step 1: Create an account in bitbucket if you don’t have one. Visit https://bitbucket.org/ and hit Get started button
Step 2: Enter your email address and you will get instructions in the email. Follow the link and set password
Step 3: For those who has already account, skip the step 1 & 2 and hit the login button
Step 4: After successful login you will land on Bitbucket dashboard, you can click + button in the left panel to create new repository
Step 5: Enter repository name and de-select Access level checkbox if you want it to public repository
Working with git
Let’s learn how to use command line utility git for version control management
Step 1: Visit https://git-scm.com/downloads site, download software based on your Operating System and install
Step 2: Open Visual Studio Code IDE, if you don’t have one visit https://code.visualstudio.com/ , download and install. Choose the folder you like to work.
Step 3: Go to Menu -> Terminal -> New Terminal to Open Terminal in Visual Studio Code. Type command git to make sure git is installed properly.
Step 3: Now we have to add user name and email to git global configuration file. Type below command in terminal
git config --global user.name "Jagadesh Kannan"
git config --global user.email "email@example.com"
Enter user name and email id you used to create Bitbucket account
Step 4: Go to browser tab where we have created repository in Bitbucket to grab repo details to clone. Copy the highlighted line in your browser and paste in Visual Studio Code terminal
git clone https://firstname.lastname@example.org/jag-missioncode/practice.git
Step 5: You can edit the files in your local copy and when you are done. Expand source control sidebar, changes tab will list the files you modified. Hover changes tab and hit + button to stage the changes and enter message you like and hit tick button to commit. Hit … button for more menus and choose push option.
If you like to use command line to commit code and push your changes run below commands
Git add -all
Git commit -m “Initial Commit”
Git remote add origin https://email@example.com/jag-missioncode/missioncode-web.git
Git push -u origin master
When you push files to remote origin, Visual Studio Code will prompt password, enter the password you have used to create bitbucket account
Publishing files to hosting space
Step 1: Visit https://filezilla-project.org/download.php to download File Transfer Protocol client and install it
Step 2: Launch FileZilla Client and enter host, username and password and hit Quick connect button
Select checkbox Always trust certificate for future sessions and hit ok button
Step 3: Choose the folder you like to deploy in the left panel, select the files, drag and drop it in the right side panel. If files are already exists in remote server, it will prompt dialog. You can choose to override if you like.
Step 4: After file has transferred successfully to remote site. Visit your host to verify your changes in the browser. In my case my host is classroom.missioncode.org