*i use vs code on windows, everything has the latest version
i have my repository cloned to one of my folders on 'desktop' so it is not in cloud. i edited one of the files in my project and tried to commit changes through vs code but the button itself wasn't working (i click on the button 'commit' (or the small one above(tried with comments too)) and it won't do anything) i also used PowerShell in the following order:
- i do some changes in the project
- type git status
- it shows:
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: index.html
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: index.html
*i have one file index.html though
4. i type git add -A
5. i type git push
6. it shows
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: index.html
and there aren't any changes on github what to do?
*though i tried to commit via git gui and it worked but didn't work via git bash
CodePudding user response:
You need to actually commit the changes.
After adding the changes with git add
, you need to commit the changes, for example with git commit -m "<Your message>"
.
After that, push the changes with git push
, and the changes will appear on github.
I would suggest you to have a look at a git cheatsheet
, and make yourself familiar with the basics of git
CodePudding user response:
As @Mime Said
you are not committing your changes before pushing you need to add new/desired/all files then commit changes then push it
git add -A
git commit -m "Your commit message"
git push
CodePudding user response:
try this
- git checkout -b new_branch
- git add .
- git commit -m "naration"
- git push -u origin new_branch
CodePudding user response:
As @Mime said, you need to actually commit your changes.
For VC Code check the docs on how to commit your staged (added) changes.
https://code.visualstudio.com/Docs/editor/versioncontrol#_commit