Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97400

Create a new commit from old

$
0
0

I got one Master branch on local and on my github repo.

As I commit locally I push it to remote (origin)

I checked out a specific commit from my github using the following command;

git checkout master
git fetch origin
git reset --hard thespecificcommitiwanted

I then worked on this commit that got fetched and intended to make a new commit and push back to origin using the following command;

git add .
git commit -m "bla"
git push origin 

and I got the following error;

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/mysamza/Jawahir.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Viewing all articles
Browse latest Browse all 97400

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>