How to use git
Git
common usage of Git.
View branches
# view remote address
git remote -v
# View all branches and the red branch represents the current branch.
git branch -a
# view git log
git log
# check what changes have been made in the current branch.
git statusView git configuration
git config --listPush files to a remote repository
# add the file to upload
git add [your files]
# wirte your commit message
git commit -m [your commit]
# push to the remote repository
git push -u origin mainPush to a new GitHub repository from local repository
# initialization
git init
# add the file to upload
git add [your files]
# wirte your commit message
git commit -m [your commit]
# change the branch from master to main (if needed)
git branch -M main
# create a remote repository on Github
git remote add origin https://github.com/your_account/your_project.git
# push to the remote repository
git push -u origin mainUse proxy
# to set http proxy
git config --global http.proxy http://127.0.0.1:1080
# to set https proxy
git config --global https.proxy https://127.0.0.1:1080
# view http proxy configuration
git config --global --get http.proxy
# view https proxy configuration
git config --global --get https.proxy
# to unset http proxy
git config --global --unset http.proxy
# to unset https proxy
git config --global --unset https.proxy