Last active
March 24, 2017 09:50
-
-
Save orangle/5369791 to your computer and use it in GitHub Desktop.
git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lzz@ubuntu:~/gitTest$ git config --global user.name 'orangle' | |
lzz@ubuntu:~/gitTest$ git config --global user.email 'liuzhizhi123@126.com' | |
lzz@ubuntu:~/gitTest$ get init | |
lzz@ubuntu:~/gitTest$ git add . | |
lzz@ubuntu:~/gitTest$ git commit | |
lzz@ubuntu:~/gitTest$ git diff | |
lzz@ubuntu:~/gitTest$ git status | |
lzz@ubuntu:~/gitTest$ git add first.txt | |
lzz@ubuntu:~/gitTest$ git commit | |
lzz@ubuntu:~/gitTest$ git log | |
#git commit -a 直接提交修改的文件 | |
#git log -p 详细的日志信息 | |
lzz@ubuntu:~/gitTest$ git branch bratest #add a branch ,name is bratest | |
lzz@ubuntu:~/gitTest$ git branch #view all branches | |
lzz@ubuntu:~/gitTest$ git checkout bratest #switch to the branch bratest | |
lzz@ubuntu:~/gitTest$ vim first.txt | |
lzz@ubuntu:~/gitTest$ git commit -a #commit the branch file | |
lzz@ubuntu:~/gitTest$ git checkout master #back to master branch | |
lzz@ubuntu:~/gitTest$ vim first.txt #changed the file | |
lzz@ubuntu:~/gitTest$ git commit -a #commit it | |
# 合并分支工作 | |
lzz@ubuntu:~/gitTest$ git merge bratest | |
#删除分支 | |
lzz@ubuntu:~/gitTest$ git branch -d bratest #大小写d不同 | |
#合作工作 第二个人 | |
lzz@ubuntu:~/gittest1$ git clone /home/lzz/gitTest/ . | |
lzz@ubuntu:~/gittest1$ vi first.txt | |
lzz@ubuntu:~/gittest1$ git commit -a | |
#第一个人的审核 | |
lzz@ubuntu:~/gitTest$ git fetch /home/lzz/gittest1/ master:otherwork #放到一个分支中 | |
lzz@ubuntu:~/gitTest$ git whatchanged -p master ..otherwork #查看下改变 | |
lzz@ubuntu:~/gitTest$ git checkout otherwork | |
lzz@ubuntu:~/gitTest$ cat first.txt #觉得不错 | |
lzz@ubuntu:~/gitTest$ git checkout master | |
lzz@ubuntu:~/gitTest$ git pull . otherwork #合并分支 | |
lzz@ubuntu:~/gitTest$ git branch -d otherwork #删除无用的分支 | |
#日志查看 | |
lzz@ubuntu:~/gittest1$ git show HEAD | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment