Skip to main content

Git Repos Regular Usage Commands

Git Commands

git config

Example: git config –global user.name “[name]”

Example: git config –global user.email “[email address]” 

This command sets the author name/email address to be used with the commits.

 

git init

Example: git init [repository name]

This command is used to start a new repository.

 

git clone

Example: git clone <path> 

This command is used to obtain a repository from an existing URL path.

 

git add

Example: git add .    ( . Adds all the files to staging area)

This command adds files to the staging.

Example: git add * 

This command adds one or more files to the staging area.

 

git commit

Example: git commit -am “[ Type in the commit message]” 

This command commit the data into local branch from staging files.

Example: git commit -a 

This command commits any files you’ve added with the git add command and also commits any files you’ve changed.

git diff

Example: git diff 

This command shows the file differences which are not yet staged.

 Example: git diff –staged

This command shows the differences between the files in the staging area and the latest version.

Example: git diff [first branch] [second branch] 

This command shows the differences between the two branches mentioned.

 

git reset

Example: git reset [file]

This command unstages the file, but it preserves the file contents.

Example: git reset [commit] 

This command undo all the commits after the specified commit and preserves the changes locally.

Example: git reset –hard [commit] 

This command discards all history and goes back to the specified commit.

 

git status

Example: git status 

This command shows all the files that have to be committed and staged already.

 

git rm

Example: git rm [file] 

This command deletes the file from your working directory and stages the deletion. 

 

git log

Example: git log 

This command is used to list the version history for the current branch.

Example: git log –follow[file] 

This command lists version history for a file, including the renaming of files also.

 

git show

Example: git show [commit] 

This command shows the metadata and content changes of the specified commit.

 

git tag

Example: git tag [commitid] 

This command is used to give tags to the specified commit.

 

git branch

Example: git branch 

This command lists all the local branches in the current repository.

Example: git branch [branch name] 

This command creates a new branch.

Example: git branch -d [branch name] 

This command deletes the feature branch.

 

git checkout

Example: git checkout [branch name] 

This command is used to switch from one branch to another.

Example: git checkout -b [branch name] 

This command creates a new branch and also switches to it.

 

git merge

Example: git merge [branch name] 

This command merges the specified branch’s history into the current branch.

 

git remote

Example: git remote add [variable name] [Remote Server Link] 

This command is used to connect your local repository to the remote server.

 

git push

Example: git push [variable name] master

This command sends the committed changes of master branch to your remote repository.

Example: git push [variable name] [branch] 

This command sends the branch commits to your remote repository.

Example: git push –all [variable name] 

This command pushes all branches to your remote repository.

Example: git push [variable name] :[branch name] 

This command deletes a branch on your remote repository.

 

git pull

Example: git pull [Repository Link] 

This command fetches and merges changes on the remote server to your working directory.

 

git stash

Example: git stash save 

This command temporarily stores all the modified tracked files.

Example: git stash pop 

This command restores the most recently stashed files.

Example: git stash list 

This command lists all stashed changesets.

Example: git stash drop 

This command discards the most recently stashed changeset.

 


Comments

Popular posts from this blog

Power Portals Deployment Using Git Repos from VS Code

  Open Visual Code - Open New Workspace  In Vs Code - Extension - Search for -  Power Platform VS Code Extension -> Install  Open Terminal - check for command  pac  (It gives the version of power cli) check for Authorization pac auth list   ( if list is there delete the list for fresh start) pac auth delete --index 1     ( if no list is found create auth ) pac auth create --url https://org.crm.dynamics.com/   ( it will ask for user name and password  ) After successful of creation  -  check for the auth pac auth list  To download portals check for paportal Microsoft Power Platform CLI command for portals is “paportal”. on the terminal - enter pac pac ( if paportal is there check for the portal list ) pac paportal list  ( It will give the website ids of paportals of the organisation ) Connected to...Portal Environment  Index      WebSiteId          ...

Environment Specific Deployment Profiles For Power Portals CLI Upload

Upload portal customisation using Environment specific portals deployment profile.  Example: Deployment profiles for Development, UAT, PROD The deployment Profile allows you to define a set of variables for the environment in YAML format. If you're creating PROD profile, you can create file under deployment-profiles with the name "PROD.deployment.yml" (that is, <profileTag>.deployment.yml).  And you can run command with tag (<profileTag>) to use this profile: example: pac paportal upload --path "X:\portals\starter-portal" --deploymentProfile PROD In this file, you can have the table (entity) name with table ID, list of attributes, and the values that you want to override while uploading the portal configuration using the deploymentProfile parameter adx_contentsnippet:     - adx_contentsnippetid: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx       adx_name: abc\prod       adx_value:  https://abc.com/xyz/prod    - adx_...

Power Apps Application Life Cycle Process For Release Management

SYNOPSIS     The goal of this blogger is to aid in the ALM process for model-driven-apps. DESCRIPTION      Most of the projects are adopting to ALM process where it can follow the agile methodologies and release the project in sprint models. so that release can be smooth and it can be easily tracked. To achieve this sprint model development. Developers need to create sprint wise solutions in the D365 CRM to move them to the higher environments based on sprint cycle. They need to check in their code into the git repository using git commands to track the changes. All the changes in the repository need to be linked with azure build and release pipelines to release those changes to higher environment.  PREREQUISITES  1. Need to have Azure Devops, Power apps and D365 CRM subscription with global admin role for setup. On Local Machine : Need to Install Vs code, Git, Power Apps CLI, Azure CLI 2. Git should be installed 3. Powerapps CLI should be installed - ...