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:
- How to solve error: failed to push some refs to ‘[email protected]:……git pull conflict
- Git pull error: pull is not possible because you have unmerged files
- Git pull undo misoperation
- Git Pull Failed solution
- Git solves pull origin error: the following untracked working tree files would be rewritten by merge
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- git pull error: unable to unlink old (Permission denied)
- How to Fix GIT Push Error
- Git error prompt: fatal: not a git repository (or any of the parent directories):. Git
- git push error failed to push some refs to solution
- Pull the git warehouse code IDEA reports an error: Clone failed: Authentication failed for’http://10.xx.XXXXXXXXXXXXXXXXX’
- git remote: HTTP Basic: Access denied error resolution
- Solve the error error fetching remote repo origin problem in Git on Jenkins
- Git remote: error: this exceeds file size limit of 100.0 MB
- Giterror: error cloning remote repo ‘origin’ hudson.plugins.git .GitException
- GitHub upload failed: git push error: failed to push some refs to exception handling
- [FAQ] after git merge, the push to Gerrit fails, indicating no new changes?
- Git push you are not allowed to upload merges
- You are not allowed to upload merges in Git push
- Git push “fatal: Authentication failed ”