---
title: "git command"
author: "maxer025"
date: "2019-04-22T17:20:48Z"
tags: []
categories: ["非技术"]
slug: "git-command"
draft: false
lastmod: "2019-04-22T17:20:48Z"
id: 2440335
url: "https://maxer025.iteye.com/blog/2440335"
---

1.	Common GIT powershell command line
Staging
Git add filename
Git status
Commit
Git commit –m “add link to …..”  (shortcut:  git command –am “fsdfsd”)
New repo
	Git init (in folder, run this, create new repo)
	Git add –A	(add all files to repo)
	Git rm –cached .\index.html	(exclude file)
	Git status
Branch
	git branch  (get all branch)
	Git branch testing  (create testing branch)
Switching branches
	Git checkout testing
	Git checkout master   (master is the default one)
Merge
	Git checkout master
	Git merge bar   (conflict)
Delete hotfix branch
	Git branch –d hotfix
Rebase
	Git rebase 
Remote repo:
git init --bare \\dongjie\rnd\INDA_GIT\test\
Git remote add origin //dongjie/rnd/INDA_GIT/test 	(add remote repo)
Git remote -v  	(list remote repo)
Git push -u origin --all    	(put to remote repo origin)
git clone  \\dongjie\rnd\INDA_GIT\test\  (clone from remote share folder to local)
git pull origin			(pull update from remote source origin, if you want to do merge, please do this before and merge)

2.	Initial a new project:
git init --bare “\\dongjie\DEPT\INDA\Dongjie RMS\project1\project1.git”

git clone //dongjie/rnd/INDA_GIT/test/test.gif f:\test
Git add -A
Git commit -m “add link to …..”  
Git push -u origin --all    


3.	Webstorm integration with GIT
Reference: https://www.jetbrains.com/webstorm/help/adding-files-to-a-local-git-repository.html

Check out from Version ControlGIT
 
4.	Get version history
	Getk –all   or use GIT GUI interface