Reputation: 341
Disclaimer: I'm new to git, and it hasn't been a gentle learning process.
After I cloned a repository, I did the following:
git fetch --all
git reset --hard origin/my_branch
git checkout my_branch
Then I made a few changes to my_file.txt and attempted to commit and push the changes:
git add my_file.txt
git commit -m "made some changes to my_file.txt"
git push
Unfortunately, every time I push I get the following message:
Everything up-to-date
even though I committed my changes. Does anyone know a fix for this?
Upvotes: 1
Views: 347
Reputation: 341
Hadn't set up my username with git, so it wasn't recognizing me. Was able to fix it with the following commands:
git config --global user.name "Name"
git config --global user.email "Email"
Upvotes: 2
Reputation: 1324367
Check the result of git status
, and git branch -avv
in order to see the state of your current branch compared to its upstream counterpart.
A better approach, when using git checkout
, would be:
git checkout -B my_branch --track origin/my_branch
# add, commit
git push
Upvotes: 1