<commit_before><commit_msg>git 的一些常用命令<commit_after>GIT嵥 ժ¼www.ruanyifeng.com
	Remote:	Զֿ̲
	Respository: ֿ(򱾵زֿ)
	Index/Stage: ݴ
	Workspace: 
	workspaceaddindex,commitزֿ⣬pushԶֿ̲
	Remote(Զֿ̲)clone/fetchزֿ,checkout
	Remoteֱpull
	
	1, ½
		# ڵǰĿ¼½һgit
		$ git init
		
		# ½һĿ¼,ʼΪgit
		$ git init [project-name]
		
		#һĿʷ
		$ git clone [url]
		
	2,
		Git ļΪ .gitconfig, ûĿ¼(ȫ), ҲĿĿ¼(Ŀ).
		# ʾǰGit
		$ git config --list
		
		# ༭Gitļ
		$ git config -e [--global]
		
		# ύʱûϢ
		$ git config [--global] user.name "[name]"
		$ git config [--global] user.email "[email address]"
		
	3, /ɾļ
		# ָļݴ
		$ git add [file1] [file2]...
		
		# ָĿ¼ݴ, Ŀ¼
		$ git add [dir]
		
		# ӵǰĿ¼ļݴ
		$ git add .
		
		# ɾļ, ɾݴ
		$ git rm [file1] [file2] ...
		
		# ֹͣ׷ָļ, ļᱣڹ
		$ git rm --cached [file]
		
		# ļ, ݴ
		$ git mv [file-original] [file-renamed]
		
	4, ύ
		# ύݴֿ
		$ git commit -m [message]
		
		# ύݴָļֿ
		$ git commit [file1] [file2] ... -m [message]
		
		# ύϴcommit֮ı仯,ֱӵֿ
		$ git commit -a
		
		# ύʱʾdiffϢ
		$ git commit -v
		
		# ʹһµcommit, ϴύ
		# ûκ±仯, дϴcommitύϢ
		$ git commit --amend -m [message]
		
		# һcommit, ָļ±仯
		$ git commit --amend <file1> <file2>
		
	5, ֧
		# гбط֧
		$ git branch
		
		# гԶ̷֧
		$ git branch -r
		
		# гбط֧Զ̷֧
		$ git branch -a
		
		# ½һ֧, Ȼڵǰ֧
		$ git branch [branch-name]
		
		# ½һ֧, л÷֧
		$ git checkout -b [branch]
		
		# ½һ֧, ָָcommit
		$ git branch [branch] [commit]
		
		# ½һ֧, ָԶ̷֧׷ٹϵ
		$ git branch --track [branch] [remote-branch]
		
		# лָ֧, ¹
		$ git checkout [branch]
		
		# ׷ٹϵ, зָ֧Զ̷֧֮
		$ git branch --set-upstream [branch] [remote-branch]

		# ϲָ֧ǰ֧
		$ git merge [branch]
		
		# ѡһcommit, ϲǰ֧
		$ git cherry-pick [commit]
		
		# ɾ֧
		$ git branch -d [branch-name]
		
		# ɾԶ̷֧
		$ git push origin --delete <branch-name>
		$ git branch -dr <remote>
		
	6, ǩ
	   	# гtag
		$ git tag
		
		# ½һtagڵǰcommit
		$ git tag [tag]
		
		# ½һtagָcommit
		$ git tag [tag] [commit]
		
		# 鿴tagϢ
		$ git show [tag]
		
		# ύָtag
		$ git push [remote] [tag]
		
		# ύtag
		$ git push [remote] --tags
		
		# ½һ֧, ָĳtag
		$ git checkout -b [branch] [tag]
		
	7, 鿴Ϣ
		# ʾбļ
		$ git status
		
		# ʾǰ֧İ汾ʷ
		$ git log
		
		# ʾcommitʷ, Լÿcommitļ
		$ git log --stat

		# ʾĳļİ汾ʷ,ļ
		$ git log --follow [file]
		$ git whatchanged [file]
		
		# ʾָļصÿdiff
		$ git log -p [file]
		
		# ʾָļʲôʲôʱ޸Ĺ
		$ git blame [file]
		
		# ʾݴ͹Ĳ
		$ git diff
		
		# ʾݴϸcommitĲ
		$ git diff --cached [<file>]
		
		# ʾ뵱ǰ֧commit֮Ĳ
		$ git diff HEAD
		
		# ʾύ֮Ĳ
		$ git diff [first-branch] ... [second-branch]
		
		# ʾĳύ仯ļ
		$ git show --name-only [commit]
		
		# ʾĳύʱ, ĳļ
		$ git show [commit]:[filename]
		
		# ʾǰ֧ύ
		$ git reflog
		
	8, Զͬ
		# Զֿ̲б䶯
		$ git fetch [remote]
		
		# ʾԶֿ̲
		$ git remote -v
		
		# ʾĳԶֿ̲Ϣ
		$ git remote show [remote]
		
		# һµԶֿ̲, 
		$ git remote add [shortname] [url]
		
		# ȡԶֿ̲ı仯, 뱾ط֧ϲ
		$ git pull [remote] [branch]
		
		# ϴָ֧Զֿ̲
		$ git push [remote] [branch]
		
		# ǿ͵ǰ֧Զֿ̲, ʹгͻ
		$ git push [remote] -force
		
		# Է֧Զֿ̲
		$ git push [remote] --all
		
	9, 
		# ָݴָļ
		$ git checkout [file]
		
		# ָĳcommitָļ
		$ git checkout [commit] [file]
		
		# ָһcommitļ
		$ git checkout .
		
		# ݴָļ,ϴcommitһ,
		$ git reset [file]
		
		# ݴ빤,ϴcommitһ
		$ git reset --hard
		
		# õǰָ֧Ϊָcommit, ͬʱݴ,
		$ git reset [commit]
		
		# õǰ֧HEADΪָcommit, ͬʱݴ͹,ָcommitһ
		$ git reset --hard [commit]
		
		# õǰHEADΪָcommit,ݴ͹
		$ git reset --keep [commit]
		
		# ½һcommit, ָcommit
		# ߵб仯ǰߵ, Ӧõǰ֧
		$ git revert [commit]
		
	10,
		# һɹѹ
		$ git archive
{'fraction_non_alphanumeric': 0.16511627906976745, 'fraction_numerical': 0.005523255813953488, 'mean_word_length': 2.0397526501766783, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6569655', 'n_tokens_mistral': 2262, 'n_tokens_neox': 1963, 'n_words': 383}