git config --global user.name "姓名"
git config --global user.email "邮箱"
git
git clone <url>
github
基于masterfetch
git checkout -b new-branch-name -t master
或git checkout -b new-branch-name origin/master
url
拉取远程分支,建立切换到本地分支git checkout -b 本地分支 origin/远程分支
(采用此种方法创建的本地分支会和远程分支创建映射关系)code
创建两个分支的映射
(将当前分支映射到远程的指定分支,注意切换到当前分支)git branch -u origin/远程分支
rem
git checkout branch-name
it
git status
ast
git diff
email
git diff origin/master 文件路径
配置
git commit -m '提交信息' filename.txt
git commit -m '提交信息' -a
git push origin new-branch-name
git fetch -p origin
git fetch
git rebase remote-branch
git push origin :branch-name
git pull <remote> <branch>
或git pull --rebase <remote> <branch>
1) git fetch
2) git checkout origin/master -- path/to/file
1) git fetch --all
2) git reset --hard origin/master
git fetch origin master:temp (采用此种方法创建的本地分支不会和远程分支创建映射关系) 比较本地的仓库和远程参考的区别 $ git diff temp 合并temp分支到master分支 $ git merge temp 若是不想要temp分支了,能够删除此分支 $ git branch -d temp