
本文共 5032 字,大约阅读时间需要 16 分钟。
������������
Git ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Git ���������
git init
������������������������ Git ���������$ git init repo_name
������������������������������������ Git ���������������������������������������
- ������������������������ Git ���������������������������������������������
from
������������������������������������������- ������������������
[to]
���������������������������������������������from
������������������������ - ������������������������������������������������������������
- ������������������������������������������������������������
- ���������������������������������������������������������������������������
- ������������������������������������������������������������������������
- ������������������������������ Git ���������������
- ��������������� Git ���������������������������������������
- ���������������������������������������������������
- ���������������������������������������������������
- ��������������������������������������������� Git ���������
- ������������������������������������������������
- ���������������������������������
- ���������������������������������������������
- ���������������������������������������������������������
- ������������������������������������������������
- ���������������������������������������������������������������
- ������������������������������������������������������
- ���������������������������������������������
- ���������������������������������������������������������
- ���������������������������������������������������������
- ���������������������������������������������������������������
- ������������������������������������������������������
$ git clone from [to]
$ git remote
������������������������������������ -v
���������
$ git remote -v
$ git remote show origin
$ git remote add custom_name repo_url
��������� custom_name
��������������������������������������������������������������������� repo_url
���������������������������
$ git remote rm origin_name
������������������������������������������������������������������������������������������������������������
������������
������������������������������������������������������������ Git ���������
$ git add file_name
��������������������������������� Git ������������������������������������������������������������������
$ git rm file_name
��������������������������������������������������������������������� -f
���������
$ git rm -f file_name
������������������������ git rm --cached file_name
������������������������������������������������������������
$ git reset HEAD file_name
������������������������ file_name
������������
$ git checkout -- file_name
$ git commit
��������������������������������������� -m
���������
$ git commit -m "������������"``��������������������������������������������������������������������### ������������Git ��������������������������� commit ������������������������������������������������������������������������1. **������������**������������������������������```bash$ git tag
������������������������������������������������������
$ git show tag_name
$ git tag tag_name
���������������������������������
$ git tag -a tag_name -m "������������"
$ git tag -d tag_name
$ git push origin tag_name
������������������������������������������������������ -���tags
���������
$ git push -���tags
$ git ls-remote --tags
������������
Git ���������������������������������������������������������������������������������������������������������
$ git branch
������ -a
������������������������������������������
$ git branch -a
$ git branch branch_name
���������
$ git checkout -b branch_name
$ git checkout a$ git merge b
$ git branch -d branch_name
������������������������������������������������������������������������������������
$ git branch -D branch_name
$ git push branch_name origin branches/branch_name
���������������������������������������������������������������
$ git remote add origin http://remote_repositoryurl.git
$ git push branch_name origin branches/branch_name
$ git checkout -b local_branch_name origin/remote_branch_name
$ git push origin --delete origin_branch_name
������������
������Git������������������������
$ git log
������ -p
������������������������������
$ git log -p
������������������������
$ git log -n
������������������������������������������������������������������
$ git log --author "John Doe"
Markdown������
Git ���������������������������������������������-face book-flavored Markdown ������������������
Markdown ��������������������������������������������������������������������������������������� Git ��������������� .md
��������������������� Markdown ������������������������������������������������������������������
������
������������������ Git ���������������������������������������������������������������������������������������������������������Git ������������������������������������������������������������������������