配置Git每次提交对应的用户信息
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
git init命令,之后将项目创建在此文件夹中,新的文件即可被git跟踪。$ git clone https://github.com/libgit2/libgit2 rename,rename为别名,不写默认文件夹名为项目名。
cat .gitignore*.log-s参数可以输出简要信息git statusgit add name--staged参数git diff-m参数填写备注,-a参数将所有跟踪的文件暂存起来一起提交git commit -m "提交备注信息"git commit --amendgit log -p-n参数显示最近的n次提交git log --statoneline或者short或full或fullergit log --pretty=oneline$ git log --pretty=format:"%h - %an, %ar : %s"$ git clone https://github.com/schacon/ticgitgit remote add name https://github.com/paulboone/ticgitgit remote rename origin newnamegit remote rm origin$git remote,默认命名为origin-v选项可以查看服务器URLgit remote show [remote-name]git fetch [remote-name]git fetch origin可以抓取最新推送的工作git pullgit push origin mastergit push origin master:newbrgit tag-a参数创建标签,-m参数添加附注信息git tag -a v1.0 -m "my v1.0"git show v1.0git push origin --tags--tags为推送所有远程仓库服务器没有的标签。原文:https://www.cnblogs.com/pycrab/p/9404310.html