Reputation: 9764
I'm new to GitHub and its terms confuse me a little. I made a commit. Now I want to change the project to a new refactored version.
Upvotes: 0
Views: 654
Reputation: 77778
Making a commit
updates the repo on your local machine. Doing a push
will replicate your repo changes on a remote.
You can commit as many times as you want locally. Once you are happy with the state of your repo, you can update the repo on Github with the following command:
git push origin master
If you want to delete a file from the repo, you can do this:
# remove the file
git rm path/to/my_file
# commit the remove to your local repo
git commit -m "removing my_file"
# update the remote (Github) repo with the removed file
git push origin master
If the repo doesn't exist on Github yet, go ahead and create a repo there. They will give you step-by-step instructions on how to make your first commit. It will likely look something like this:
# go to project files
cd path/to/project
# initialize git repo
git init
# stage all project files in current directory to be committed
git add .
# make first commit
git commit -m "first commit"
# add the Github remote
git remote add origin <YOUR GITHUB URL>
# send repo to git
git push origin master
Upvotes: 1
Reputation: 3713
a commit to github is in two steps: ->first use command commit to save the changes localy ->then use push commande to save the changes on github
Upvotes: 1