git command (continuously updated)

1. Delete the remote branch

git push origin :[remote branch name]

 

2. Delete the local branch

git branch -d [local branch name]

Force delete:

git branch -D [local branch name]

 

3. Rename the branch

Under branch:

git branch -m [new name]

Replacing remote, can also be used to upload local branches:

git push origin [new name]:[old name]

There must be a space after the new name

 

3.ignore the modification of some files

 

 .gitignore can only ignore files that were not originally tracked. If some files have been included in version management, modifying .gitignore is invalid.

    The correct approach is to manually set each cloned repository not to check for changes to specific files.
    git update-index --assume-unchanged PATH Enter files to ignore at PATH.

    If you want to be included in the track again, execute

    git update-index --no-assume-unchanged PATH

 

4. View the remote warehouse address

git remote -v

This command can display the remote clone address of the corresponding project.

 

5. Get the remote branch

git fetch origin

git checkout -b {local_name} origin/{remote_name}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326874252&siteId=291194637