Git Command Line

cheepie

New Member
Joined
Dec 8, 2020
Messages
3
Reaction score
0
Credits
22
Hey I’m getting this error whenever I try to push it out to my master account, please help me?

If anybody can video chat with me, so we can walk through... I’ll highly appreciate it. Thanks in advance.


Screen Shot 2020-12-05 at 9.46.59 AM.png
 


Moving this to Command Line, where it will receive a more qualified audience.

Note that with text, it is better to cut and paste in the Code fields available as a choice in the dropdown menu in your Reply Pane toolbar. 3 dots and a down arrow, icon.

Are you on Kali? If not, which distro?

Cheers

Chris Turner
wizardfromoz
 
Are you on Kali? If not, which distro?

Cheers

Chris Turner
wizardfromoz
OP is on MacOS if you check the terminal in their screenshot you will see that the paths differ from a GNU/Linux distribution.
Code:
/Users/sniper/cloned-Repo
Git is nothing specific to GNU/Linux but works on Windows and MacOS as well.
 
Thanks, my friend, missed that :)

@cheepie if this is not about Linux, we can't help.

Unless I hear a good reason from you otherwise, I'll close and then delete this Thread.

Wizard
 
Hold your horses @wizardfromoz - although it's not linux per-se, the thread could still be useful for other git users on Linux.org.

Personally, I haven't seen those messages from git before, so I'd need to look up what's causing the problem there.

In the meantime - @cheepie - If you cd into the root of the source tree for your project, what is the output of the command:
Bash:
git remote -v
 
Ha - goes to show how often I've used git recently...... Which is to say "Not much!"

I've just used git to update dwm on my work PC and got the warning message that @cheepie is getting.
That is apparently because git's behavior when pulling has changed.

Previously git would do a merge by default - unless the user specified another action. Apparently a lot of git users found this sub-optimal, and wanted a way to specify which action to take by default. So now you should specify the default action by setting one of the settings specified in the warning message.

So to get rid of the first warning message - about reconiling divergent branches - you need to run one of the following commands to set the default action for pulling:
Bash:
git config pull.rebase false
That is the setting for the original, default "merge" option

Bash:
git config pull.rebase true
That is the setting for "rebase"

Or
Bash:
git config pull.ff only
Which is the setting for "fast forward only" - which is apparently what many users prefer to use.
Personally, I've always been happy with "merge" by default.

NOTE: Using git config will only apply that setting to the repository you are currently in.
If you want to apply it globally, then use git config --global to set the setting instead.

Choosing and setting one of the above settings will set the default action to use with git pull and will prevent that warning message from appearing.

Also, once you've set the default action - if you ever need to override it and use another, you can specify it.

So, for example:
If you've explicitly set git pull to "merge" by default, globally. And you want to do a fast-forward in the repository you're working in. You can override pulls specified, default, global "merge" action like this:
Bash:
git pull -ff
And for that pull, you will use the "fast forward" action instead.

I've never seen the other error messages though.
From a quick bit of duckduckgo-fu, it seems to be related to an attempt to push to a non-bare repository.
Apparently github and gitlab repos are bare repositories.

I'm not sure what to suggest with this. I would need some information about @cheepie 's remote settings for their repo.
 
Last edited:
@JasKinasis - you try to hold back my horses, Jas ... they wear me out

6Qucfd2.png


Wizard
 

Staff online


Top