美文网首页
Git Commands

Git Commands

作者: sabrinachen321 | 来源:发表于2018-06-11 10:53 被阅读0次

Clone

1. git clone <repo-address>

2. Check the remote repository name: git remote -v

3. Change the remote address: git remote set-url origin [url]

Branch

1. Get all remote branches information: git fetch

2. Pull the current remote branch to local: git pull

3. git checkout <branch-name>

4. Start a new branch: git checkout -b <new-branch-name>

5. Push the new local branch to remote: git push origin <new-branch-name>

6. Delete the branch from remote: git push origin --delete <new-branch-name>

Submodule

1. git submodule update --init --recursive

2. Update the submodule

    a. Do “git diff” in the upper directory to get the submodule CLN, then use "git checkout <CLN>" to checkout the CLN in submodule's directory

    c. git submodule update

Tag

Tag is a reference to some commit. We can also checkout a branch via its commit number.

1. List all the version tags: git tag

2. See the current tag: git describe

Rebase

https://blog.csdn.net/wh_19910525/article/details/7554489

https://github.com/geeeeeeeeek/git-recipes/wiki/5.1-%E4%BB%A3%E7%A0%81%E5%90%88%E5%B9%B6%EF%BC%9AMerge%E3%80%81Rebase-%E7%9A%84%E9%80%89%E6%8B%A9

Commit

1. git add -A

2. git commit –m “commit description”

3. git log

4. git push

5. delete untracked files

    a. files: git clean -f

    b. files and directories: git clean -fd

    c. check what will be deleted first: git clean -n

相关文章

  • git help

    These are common Git commands used in various situations:...

  • Git Commands

    Clone 1. git clone 2.Check the remote repo...

  • git commands

    1. To see the URL of local repository git remote show ori...

  • git: commands

    …or create a new repository on the command line echo "# g...

  • git commands

    暂存区和分支都属于版本库,修改的地方是工作区。 创建目录:mkdir dir_name显示当前目录:pwd初始化库...

  • Git笔记

    Git Commands tips:<*> means required,[*] means optional 基...

  • 记不住git命令?试试这个命令浏览网站

    Find the right git commands without digging through the w...

  • Basic Git commands

    To use Git, developers use specific commands to copy, cre...

  • A Cup of Git Latte

    Quick reference for some frequently used Git commands. Se...

  • git cmd

    GitHub Commands git 常用命令 注册 SSH key 以便git bash 可以push req...

网友评论

      本文标题:Git Commands

      本文链接:https://www.haomeiwen.com/subject/gzpceftx.html