Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not push to a remote Git repository - Everything up-to-date

I need to push my changes to a remote repo for the first time

// I added the other repo as a remote
$ git remote add devstage -f <Other-Repo>

// Merged the files from devstage to my local
$ git merge devstage/master -s recursive -X ours

// Executing Everything up-to-date
$ git push devstage HEAD

But the files were not really pushed to the Other-Repo.

Am I missing something?? None of the files in my local are staged. If I open a file stage it and push it to the remote it will be pushed.

like image 994
special0ne Avatar asked Oct 01 '22 20:10

special0ne


1 Answers

A push shouldn't return everything is up-to-date, unless you are in a detached HEAD mode.

That would mean you git branch doesn't show any active branch (one with a '*' in front of it).
If that is the case, see "How to fix a Git detached head?".

Also, rather than pushing HEAD, use a branch name.
For your first push:

git push -u devstage master

The -u establishes a tracking relationship with the upstream branch devstage/master. Then a simple git push will be enough for future pushes.
See why in "Why do I need to explicitly push a new branch?"

like image 152
VonC Avatar answered Oct 13 '22 12:10

VonC