git config --global user.name ‘<your_github_nick_name>‘
git config --global user.email <your_github_sign_in_email_address>$ git init* 以斜杠“/”开头表示目录;
* 以星号“*”通配多个字符;
* 以问号“?”通配单个字符
* 以方括号“[]”包含单个字符的匹配列表;
* 以叹号“!”表示不忽略(跟踪)匹配到的文件或目录;
此外,git 对于 .ignore 配置文件是按行从上到下进行规则匹配的,意味着如果前面的规则匹配的范围更大,则后面的规则将不会生效;举例说明:
# ignore special folder
.git/*
.vscode/*
venv/*
# ignore all folder
*.pytest_cache/
# ignore special file
*.bak$ git add .$ git commit -m "first commit"https://github.com/thuanghai/test.git
(2)提交到远程仓库,‘your_nickname‘比如为origin
git remote add <your_nickname> https://github.com/thuanghai/test.git
注:把本地的repository push到github。其间需要输入github的账号和密码。
原文:http://blog.51cto.com/huanghai/2133157