Git Operation_xmind

99 阅读1分钟

Git Operation

git

git cmd

  • git set up

    • git init --bare xxx.git
  • git clone

    • git clone ssh://userid@10.100.150.13/home/project/xxx.git
  • Git safety push procedure

    1. git add filename
      1a. git reset HEAD . //撤销git add
    2. git comment -m “comments”
    3. git pull
    4. git push
  • Git branch

    • Git branch status

      • git branch -a
    • switch branch

      • git checkout <branch_name>
    • new branch

      • git checkout -b dev
  • Tag

    • tag list

      • git tag
      • git tag -l
    • tag create

      • git tag -a <tag_name> -m “tag comments”
    • tag push

      • git push origin <tag_name>
      • git push origin --tags
    • switch to tag version

      • git checkout <tag_name>
    • revise from tag version

      • git checkout -b <branch_name> <tag_name>
    • tag delete

      • local: git tag -d <tag_name>
      • remote: git push origin --delete tag <tag_name>
  • get a single file

    • git checkout <branch_name> <file_name>
  • push to remote branch

    • git push origin <local_branch>:<remote_branch>
  • git log

    • latest commit with content diff

      • git log -n 1 --stat
  • git diff

    • git diff master origin/master //比较本地仓库 vs 远程仓库

git游戏

在这里插入图片描述


repo

repo note

  • repo related branch
  • log

gerrit

push to gerrit

  • git push origin HEAD:refs/for/master

XMind - Trial Version