3

I have a project on local and I would like to push the project on a github repository On local I have many commits

To push on github I use the following commande lines:

git remote add origin https://github.com/yourusername/your-repo-name.git

git pull origin master

git push origin master

It works but I have the first version of the project corresponds to the oldest commit

When I use the following command: git branch -vv --all

I have:

 master    4da82c9 first commit
* old-state 35dd8a0 last commit

I forget something but I don't know what.

Paolo
  • 21,270
  • 6
  • 38
  • 69
Cyril Bron
  • 153
  • 1
  • 5

1 Answers1

0

A pull origin master while you are on old-state would update old-state only, not master.

At least, checkout (or switch) to master first.

git checkout master
# or with Git 2.23+
git switch master

Then:

git push -u origin master
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250