How to push to github from cloud9?
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 s开发者_开发问答till 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
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
精彩评论