Git
Head mean current commits
Git init 在将当前路径的文件夹创建为repository
Git log 查看commitsid
git add 增加文件到stagingarea
git status 查看stagingarea的情况(文件)
git commit 将stagingarea中的文件提交到repository
git checkout 回滚到commitId的版本,并创造出该ID的分支(但是MASTER没有影响)
git checkout branchname : branch由master切换到名字为branchname的branch
git checkout –b newbranchname: 创建一个新的branch withname,并切换到新建的branch
git reset commit id 回滚到commit Id的版本(当在master执行时,master就会返回该commitID的版本,不会创建新版本)
git show commit1 比较commit1和它父类的commit的差别,我们并不需要明确找出commit2的ID
git diff commit1 commit2 比较commit1 commit2两个ID的差别
git diff –staged 比较repository和staging area的差别
git diff 比较working directory和staging area的差别
git branch no argument 查看全部的branch,并用星号*标记当前处在的branch
git branch newbranchname 创建一个新的branch with name
git branch –d branchname: 删除branch
git merge branch1 branch2 把branch2并入branch1(如果有冲突需要手动接触冲突然后在此合并)
solove conflict
GitHub
git remote 查看当前全部的remote
git remote add origin https:// 创建远程remote关联到GitHub上的repository并标记为origin
git push argument1 argument2 参数1代表我想挂载到的远程remote,参数2是我想将哪一个当地branch挂载到GitHub上
git pull argument1 argument2 参数1代表我想同步的远程remote到本地local,参数2是我想让哪一个当地branch同步于GitHub(pull takes a branch from a remote and brings it to your localrepository,push does the opposite,taking a branch and pusing it to remote)
Fork is a lot like cloning ,在GitHub上复制别人的repository到你自己的GitHub账户中。
Collaborators 在GitHub中赋予这些用户修改(push)你当前repository的权限
Fetching updates origin/master with the contentsof GitHub’s master branch, and then origin/master is merged into master ,so gitpull is as same as git fetch followed by git merge
Fast-forward merge : you can reach a fromb, so you can do a fast-forward merge.
Pull requests :
Git is local,GitHubis where we shares and collaborate with other people
Remote name (1)origin: a remote that pointsto the original repository on your repository GitHub.
(2)upstream: a remote that points to theoriginal repository you forked (from other people )on GitHub.
Q:如何看BASH里的帮助提示?