Git pull error - Pulling without specifying how to reconcile divergent branches is discouraged
When trying to do git pull I get the following error message:
[advancew@sjc02 public_html]$ git pull origin main
Username for 'https://gitlab.com': davyyg
Password for 'https://[email protected]':
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.com/davyyg/zws.git/'
[advancew@sjc02 public_html]$ git pull origin main
Username for 'https://gitlab.com': davyyg
Password for 'https://[email protected]':
From https://gitlab.com/davy_yg/zws
* branch main -> FETCH_HEAD
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
Committer identity unknown
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for <[email protected]>) not allowed
[advancew@sjc02 public_html]$
[advancew@sjc02 public_html]$ git remote set-url origin https://gitlab.com/davy_yg/zws.git
[advancew@sjc02 public_html]$ git pull origin main
Username for 'https://gitlab.com': davy_yg
Password for 'https://[email protected]':
From https://gitlab.com/davy_yg/zws
* branch main -> FETCH_HEAD
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
Committer identity unknown
*** Please tell me who you are.
Run
Also I am confused how you got to where you are? Normally you start by running git clone https://gitlab.com/davy_yg/zws.git which will make sure the repo url is correct.
Okay this time, I deleted everything in public_html in the server folder.
[advancew@sjc02 public_html]$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /home/advancew/public_html/.git/
[advancew@sjc02 public_html]$ git remote add origin https://gitlab.com/davy_yg/zws.git
[advancew@sjc02 public_html]$ git pull origin main
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
[advancew@sjc02 public_html]$ git pull origin main
error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.
Before this I : git push -f origin main
to gitlab since I want to replace everything in gitlab with my new editted files.
@Sinnbeck The prob with git clone is that it creates a folder also whereas I want the folder content only inside public_html. Do I have to create the folder outside public_html and move the content to public_html every time after I pull the content from gitlab ?
@davy_yg No just clone it and move all content to the correct folder (remember the .git folder). You just need to do so once. And you only clone the very first time. All times afterwards you pull