git使用 (一)

git使用 (一)_第1张图片

  1. this is a first time push;

    git status–>git add 文件名称/*–>git commit–>git push

  2. this is a time pull and push;

    git pull–>解决冲突–> git add commit push

  3. this is a time amend commit note

    git commit --amend 最后一次
    git rebase -i HEAD~3 最近3条
    查看了日志,把一行改成edit ,commit --amend修改后,rebase --continue
    git push -f 强制推送
    -f 是强制覆盖,会将本地代码覆盖远程代码,要谨慎使用

  4. this is a time fallback history record

    git log/relog reset --hard 记录号

  5. this is a new develop

  6. find a bug and need create new branch to fix bug

    检出分支 git clone -b bug_1.0 https://gitee.com/rebeginner/git_study.git
    切换分支 checkout bug_1.0
    分支提交 发布新版本

  7. 合并此次bug修改分支到主分支master

    git merge bug_1.0
    git pull https://gitee.com/rebeginner/git_study.git bug_1.0
    git push origin master

你可能感兴趣的:(git)