标签:path math origin == one upd global 切换 repos
git init
git remote add {别名,可代替url} url
eg:
git remote add pb git://github.com/paulboone/ticgit.git
git remote #查看远程库(只能看到自定义的别名)
git remote -v #查看远程库并列出详细信息
git remote rm [别名]
git pull <origin[远程库别名]> <master[本地库]>
==>
git fetch ;
git merge;
git push <origin(别名)> <master>
git branch (-a) 查看本地分支(和远端分支)
git branch 分支名
git checkout 分支名
git commit -am filename "....." ==> git add filename; git commit -m "....";
git rm <file>
git rm -f <file>
git rm --cached <file>
git rm -r <filepath>
git mv oldfile newfile
git log #获取commit后面的提交版本号
commit 09921c2b40eec00e6518d644eee9488335832989
Author: jfxugithub <fxujunfeng@foxmail.com>
Date: Thu Nov 15 11:39:54 2018 +0800
修改bug
commit 62b4cd6e4a4fe426f4a91183935b19b4cb348475
Merge: 70940d0 6c786de
Author: jfxugithub <fxujunfeng@foxmail.com>
Date: Thu Nov 15 11:25:55 2018 +0800
Merge branch ‘master‘ of github.com:jfxugithub/gittest
git reset --hard 62b4cd6e4a4fe426f4a91183935b19b4cb348475 #代码回退到之前的状态
$ git config --list
user.email=fxujunfeng@foxmail.com
user.name=fionns
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.fionn.url=git@gitee.com:fionns/KnowYou.git
remote.fionn.fetch=+refs/heads/*:refs/remotes/fionn/*
# 修改git提交用户的名字
$git config --global user.name fionns
标签:path math origin == one upd global 切换 repos
原文地址:https://www.cnblogs.com/jfxu/p/11986655.html