Basic GIT Commands
$ git config — global user.name “[name]”
Sets the name that will be assigned to commits from the local PC.
$ git config — global user.email “[email address]”
Sets the email that will be assigned to commits from the local PC.
$ git init [project-name]
Creates a new git repository in your local machine with the given name (project-name). This repository is initially empty.
$ git add [file]
This command is used to add files into the git staging area. Before committing the file, it should be added to the git staging area.
$ git commit -m “[descriptive message]”
Changes made to the file in the local repository is recorded. For our reference, we can enter a descriptive message mentioning the changes done in files. Each commit is given a unique ID.
$ git status
This command is used to view the current state of the repository. Returns a list of new or modified files to be committed.
$ git branch
Lists all the branches in your repository.
$ git branch [branch-name]
Creates a new branch with the specified name.
$ git checkout [branch-name]
Switching from one branch to another.
$ git merge [branch]
Combines/Integrates specified branches together.
$ git branch -d [branch-name]
Deletes the branch with the name given.
$ git remote add origin <server>
Configure and connects a local repository to a remote repository
$ git clone [url]
Creates a local repository from a working remote repository that already exists.
$ git add [file]
Adds the specified file for staging.
$ git push [alias] [branch]
Send the committed files in your local repository to the specified branch of the remote repository.
$ git pull
Downloads and merge changes on the remote repository to the local repository.
References –
https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html
https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf