Git Commands
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
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