All commands have been tested in - git version 2.9.0.windows.1

(Make sure to install git before trying below)

Just type git at command prompt to see if you already installed it.

1. Clone a remote copy locally

git clone http://github.com/stash/scm/ma/middleware.git

2.  List branches

git branch

3. Create a branch to work on locally

git branch branch1

4. checkout this new branch locally

git checkout branch1

5. Change file and do a diff - You will see the changes

C:\git-vij\middleware>git diff
diff --git a/properties-files/domain-properties-files/my_domain_test.properties b/properties-files/domain-properties-files/my_domain_test.properties
index 894a2fc..0485641 100644
--- a/properties-files/domain-properties-files/my_domain_test.properties
+++ b/properties-files/domain-properties-files/my_domain_test.properties
@@ -4,7 +4,7 @@
 # This is an auto-generated template from the dafault basic WLS template which is wls-domain-template.properties
 # You may add remove properties to this template to generate the keys file and then finally a properties file
 #############################################################################################################################################################
-# Weblogic credentials
+# Weblogic credentials go here
 ###############################################################################

 6. Add changed file to your local branch (. for all changed)
 
 git add .

<-- For Specfic files only
git add file1
git commit file1 -m "bugfix, in file1"
git add file2
git commit file2 -m "new feature, in file2"
<!--

 
7. Then commit
 
 git commit -m "Adding changed file/s"


8. Now push your branch to remote repo if you wish to
 
 git push --set-upstream origin branch1

 git-simple2
9. Change to master
 
 git branch master
 
 Note : git branch > will show active branch with *
 
 
10. Merge branch1 changes in master
 
 git merge branch1
 
11. Push master to remote
 
 git push origin
 
12. List tags
 
 git tag
 
13. Create new tag
 
 git tag -a "v3.0"  -m "tagging latest changes"
 
14. Push a single tag
 
 git push origin "tag-name"
 
 git push origin "v3.0"
 
 git push --tags (To push all local tags - Think, Do you really need to do this ?)
 
15. Delete local tag
 
 git tag -d "tag-name"
 
 git tag -d "v3.0"
 
16. Delete remote tag
 
git push origin :refs/tags/v3.0
 
17. Delete local branch

git branch -d "branch-name"

18. To Delete a remote branch

git push origin --delete <branch_name>

OR

git push origin :<branch_name>

C:\git-vij\middleware>git push origin --delete branch1
To http://github.com/stash/scm/ma/middleware.git
 - [deleted]         branch1

C:\git-vij\middleware>git push origin :branch1
error: unable to delete 'branch1': remote ref does not exist
error: failed to push some refs to 'http://github.com/stash/scm/ma/middleware.git'

C:\git-vij\middleware>


19. Create a branch from tag

git tag -l

OR

git tag 

git branch branch-name tag-name

git branch branch1 v1.0
NOTE :- Use git config to configure 

$ git config --global user.name "Vijay Jadhav"
$ git config --global user.email vijayJ@example.com

OR find local config in your repository's .git/config file.
C:\git-vij\middleware>git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/mycerts/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
gui.recentrepo=C:/MySoftware/Git_Repository
user.name=Vijay Jadhav
user.email=vijayJ@example.com
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=http://github.com/stash/scm/ma/middleware.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

C:\git-vij\middleware>

Working with Remotes

C:\git-vij\middleware>git remote -v
origin  http://github//middleware.git (fetch)
origin  http://github//middleware.git (push)

C:\git-vij\middleware>git remote show origin
* remote origin
  Fetch URL: http://github//middleware.git
  Push  URL: http://github//middleware.git
  HEAD branch: master
  Remote branches:
    branch1 tracked
    master  tracked
  Local branches configured for 'git pull':
    branch1 merges with remote branch1
    master  merges with remote master
  Local refs configured for 'git push':
    branch1 pushes to branch1 (up to date)
    master  pushes to master  (up to date)

C:\git-vij\middleware>

https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes