How to update changes on GitHub
I initially added some files on GitHub manually i.e not using the terminal. Now I made some changes, how can I update the changes using the terminal on vs code?
2 Replies
Run
git status
to see the files that have been created, modified or deleted since your last commit.
Run git add <file1> <file2> <file3> ...
to specify which files should be included in your next commit. If all files should be included, you can instead run git add .
(mind the dot).
Run git commit -m "<descriptive message of changes>"
to commit those files (mind the quotes). If you made a lot of changes (you shouldn't) or need to give a more thorough explanation, run git commit
and that will show you a terminal-based text editor where you can write your commit message. Upon saving your changes, it will be committed.
Run git push
to upload the current branch to GitHub. If this is the first time running this command you will need to specify the upstream. Normally this command will do: git push -u origin master
. Change master
with the name of your branch e.g., main
If you added files via the web UI and want to sync them to your local repo using the CLI, do a
git pull
.