[Git] git pull pull remote git push to remote git commit submit reject

The GIT command has been introduced in previous blog posts. But for some scenes, it is still a little strange to use
git command git introduction and common command list

[scenario 1] pull the remote git warehouse branch to the local (this branch does not exist locally)

# recommand method
git fetch
# git checkout Remote branch name (dev is the example branch name)
git checkout dev
git pull

# other method (Not recommand)
git fetch
# git checkout -blocal branch name origin/remote branch name # actually associates the remote branch to the local branch
git checkout -b dev origin/dev
git pull

git push

[scenario 2] push the newly created local branch to the remote git warehouse
[scenario 3] solve [remote rejected] intg/dev – & gt; Intg/dev (hook declined) problem

# Check out the new local branch. The contents of the new branch are identical to the contents of the previous branch. When it is created, it will automatically switch to the new branch
git checkout -b new branch name
# [Suggestions] After modifying or creating a new file, it is recommended that you run the following two lines before committing
# Execute the command to resolve the [remote rejected] intg/dev -> intg/dev (hook declined) issue
git stash
git pull --rebase
git commit -m "comments in quotes for commit"
git push --set-upstream origin branch name


Read More: