git command to create branch|merge branch|delete branch

1. Create test branch submission steps

1. List all branches:

        # git branch -a

2. Create the test branch:

        # git branch test

3. Switch to the test branch:

        # git checkout test

4. Add add modification:

        # git add .

5. Add commit comments:

        # git commit -m "Commit code for the first time"

6. Submit to the server:

        # git push origin test

2. Merge the test branch into the main local branch

1. Create a test branch:

        # git branch test

2. Switch to the test branch:

        # git checkout test

3. Add a readme.txt file to the test branch:

        # touch readme.txt

        # git add readme.txt

4. Submit the commit local file:

        # git commit -m "Add readme.txt"

5. Switch to the main branch:

        # git checkout main

6. Merge the test branch into the main branch:

        # git merge test

7. Submit the main branch to the server:

        # git push origin main

3. Delete the test branch

1.删除test分支:

    # git branch -d test

四、远程仓库地址

    # git remote -v

Five, clone specified branch

    # git clone -b branch name branch warehouse address (git clone -b dev_branch https://xxx.git)

Guess you like

Origin blog.csdn.net/sunbinkang/article/details/123984685