Giter Club home page Giter Club logo

murphy's Introduction

readme

测试一下先写个readme吧

hello

git status
git add file
git commit -m "comment"
git checkout -b dev
git branch
git rm file
git log
git reflog
git diff file
git reset --hard HEAD^
git remote add origin [email protected]:michaelliao/learngit.git
git clone git@https://murphy.git
git push origin master
git push -u origin master第一次推送master分支的所有内容

Git鼓励大量使用分支:

查看分支:git branch

创建分支:git branch

切换分支:git checkout

创建+切换分支:git checkout -b

合并某分支到当前分支:git merge

删除分支:git branch -d

git branch dev
git checkout dev
$ git checkout master
Switched to branch 'master'
git merge dev
$ git add readme.txt 
$ git commit -m "add merge"
[dev 6224937] add merge
 1 file changed, 1 insertion(+)
$ git merge --no-ff -m "merge with no-ff" dev
Merge made by the 'recursive' strategy.
 readme.txt |    1 +
 1 file changed, 1 insertion(+)

--no-ff 参数是不使用frist-forward模式合并分支,保留合并记录。

--pretty=oneline

git log --graph --pretty=oneline --abbrev-commit
git merge --no-ff -m "merge with no-ff" dev  这样合并可以查看分支合并的日志
git stash 保存现场
git stash pop 提取现场
git stash list 现场列表
git stash apply stash@{0} 提取指定现场

BUG修复

先将dev保存现场,然后切回master分支,创建bug分支,修复bug合并分支,然后切回dev分支,提取现场。

git stash list
git stash apply stash@{0}
git stash drop stash@{0}
git stash pop
git stash
git checkout dev
git merge --no-ff -m "merged bug fix issue-101" issue-101

murphy's People

Watchers

James Cloos avatar wuhuafeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.