Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Install GIT
For window:
Install GIT software from one of the below URLs.
https://git-scm.com/download/win
https://www.sourcetreeapp.com/

For Ubuntu:
sudo apt-get install git

Configure GIT account on your system
Open git command console and run two commands. Replace email and username of your git in the command.
git config –global user.email “email address”
git config –global user.name “password”

Clone GIT branch
This is the first command to initialize the project

Go to GitHub
Go to branch from where you want to clone
Click on ‘clone or download’ button
Copy ‘clone with https’ URL e.g. https://github.com/……../…….git
Create a directory on your system and go to the new directory
Run under command:
git clone https://github.com/……../…….git

GIT checkout
You can switch one branch to another branch
eg. git checkout dev[branch name]
git checkout design

GIT Add
You can add file to GIT
git add.

GIT commit
git commit -m ‘added files’

GIT Push
Push the branch on git :
git push origin [name_of_your_new_branch]
eg. git push origin dev

GIT Pull
Pull the changes from git to your system :
git pull

GIT Remove
git rm filename
Please don’t remove file or folder without git commands.

List Branches
You can see all branches created by using :
git branch

GIT Status
This is the very very useful command, so you can use this command before using any command to know exactly where are you. To heck updated code and also confirmation of which branch you stand
git status

Git command for testing with sequence
– git init
– git clone
– git checkout branch_name
– Add test file like test.txt
– git add.
– git commit -m ‘add test file’
– git push origin branch_name
– Put username and password of git when asked
– Check new added test.txt file on branch of git

Create Form 

<div class="col-sm-6 col-md-6 col-lg-6 contact_left">
<form class="contact_main-form" action="sendMail.php" method="post" id="my_form">
<div class="form-group">
<label class="text_name_c_form">Name:</label>
<input type="text" class="form-control input_form_c" id="Email" name="name" required>
</div>
<div class="form-group">
<label class="text_name_c_form">Email:</label>
<input type="email" class="form-control input_form_c" id="Email" name="email" required>
</div>
<div class="form-group">
<label class="text_name_c_form">Subject:</label>
<input type="text" class="form-control input_form_c" id="Email" name="subject" required>
</div>

<div class="form-group">
<label class="text_name_c_form msg_1">Message:</label>
<textarea class="form-control input_form_c text-area" rows="3" name="msg" minlength=50 required></textarea>
</div>

<button type="submit" name="submit" class="btn btn-default">Send</button>

<div class="g-recaptcha" data-sitekey="your key"></div>

</form>
<div id="server-results"><!-- For server results --></div>

</div>

sendMail.php

<?php
$email;$message;$captcha; $subject;
$ToEmail = 'your@testmail.com';
$EmailSubject = 'Site contact form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$name = "Name: ".$_POST["name"]."";
$email .= "Email: ".$_POST["email"]."";
$sub .= "Subject: ".nl2br($_POST["subject"])."";
$msg .= "Message: ".nl2br($_POST["msg"])."";
$content = '<div style="width:90%;margin:0 auto;text-align:left;padding-left:4px">

<strong>First Name:</strong> '.$name.'<br>

<strong>Subject:</strong> '.$sub.'<br>

<strong>Email:</strong> '.$email.'<br>

<strong>Message:</strong> '.$msg.'<br>

.</div>';
if ($_POST["email"]<>'') {

if(isset($_POST['email'])){
$email=$_POST['email'];

}
if(isset($_POST['subject'])){
$subject=$_POST['subject'];
}

if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
echo '<h2>Please check the the captcha form.</h2>';

}
$secretKey = "Your Google Secret key";
$ip = $_SERVER['REMOTE_ADDR'];
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
$responseKeys = json_decode($response,true); ?>
<?php
if(intval($responseKeys["success"]) !== 1) { ?>
<?php } else { ?> <?php
mail($ToEmail, $EmailSubject, $content , $mailheader) or die ("Failure"); ?>
<div class="alert alert-success"> <strong>Thank you for your message!
We will answer you within maximum 48h check</strong>
</div>
<?php
}
}
?>

Ajax

jQuery("#my_form").submit(function(event){
event.preventDefault(); //prevent default action
var post_url = $(this).attr("action"); //get form action url
var request_method = $(this).attr("method"); //get form GET/POST method
var form_data = new FormData(this); //Creates new FormData object
jQuery.ajax({
url : post_url,
type: request_method,
data : form_data,
contentType: false,
cache: false,
processData:false
}).done(function(response){ //
$("#server-results").html(response);
});
});

<script src="http://maps.google.com/maps/api/js?key=YourKey&callbacksensor=false"></script>
 
Call Where you want to show Map 
<div id="map" style="width: 500px; height: 400px;"></div>

<script>
var locations = [
[
“Your adress1”,
28.541868,
77.1161973,
1,

],
[
“Your adress2”,
28.634747,
77.2187213,
2,

],
[
“Your adress3”,
28.567317,
77.2390653,
3,

],

]

var map = new google.maps.Map(document.getElementById(‘map’), {
zoom: 8,
// center: new google.maps.LatLng(-33.92, 151.25),
center: new google.maps.LatLng(28.541868, 77.1161973),
mapTypeId: google.maps.MapTypeId.ROADMAP
});

var infowindow = new google.maps.InfoWindow();

var marker, i;

for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});

google.maps.event.addListener(marker, ‘click’, (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0], locations[i][6]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStore = $storeManager->getStore();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();
$tableName = $resource->getTableName('my_table'); // the table name in this example is 'my_table'
$sql1 = "SELECT * FROM " . $tableName;
$result1 = $connection->fetchAll($sql1);
echo '<pre>'; print_r($result1); echo '</pre>'