I am trying to push some changes from cloud9 to a github repository but I am hitting a roadblock.
I can clone OK with ssh, and everything seems to be OK, I make my changes, save the changes in cloud9 (when I go back the changes are still there), then I do git commit
and get:
no changes added to commit (use "git add" and/or "git commit -a")
but I just need to commit changes to an existing file not to add. So obviously when I try to git push origin master
there's nothing to push.
I tried with multiple github repos and I get the same result.
What am I missing?
Any help appreciated!
P.S. Oh, btw I suck at git
In the command line, navigate to the root directory of your project. Initialize the local directory as a Git repository. To create a repository for your project on GitHub, use the gh repo create subcommand. When prompted, select Push an existing local repository to GitHub and enter the desired name for your repository.
The message shows that you are not adding changed/tracked files to commit.
Try with -am
switch to ADD and Commit in one operation:
git commit -am "your message goes here"
git push
Git separates committing from adding changes. You first have to add all changes you want to appear in the commit:
#1: Add any new files as part of the commit
# or use git add -p to interactively select hunks to stage
git add file1 file2 …
#2: Commit to local
git commit -m "Commit message goes here"
#3: Push your commit/changes to the host (github)
git push
You should now have all your changes on github.
Alternatively, you can do the commit, and add/modify in one line, this may include undesired files into your changeset.
#1 Add files commit to local
git commit -a -m "Commit message goes here"
#2 Push your commit/messages to the host (github)
git push
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With