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
  • 13,742
  • 6
  • 28
  • 51
Cyril Bron
  • 123
  • 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,129,465
  • 480
  • 4,036
  • 4,755