I ran "git add ." and then "git commit -m 'project files'", which responded with this:
[master (root-commit) ca52fe0] project files 981 files changed, 257939 insertions(+), 0 deletions(-) create mode 100644 index.php create mode 100644 license.txt create mode 100644 readme.html create mode 100644 wp-activate.php ...
But I look at repo and my "my project files" commit is not there. So then I ran git pull and got this:
You asked me to pull without telling me which branch you want to merge with, and 'branch.master.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details.
and then git push and checked again and still my commits are not on github repo. The only time I can see the commit is when I run "git log":
MacBook-myproject myusername$ git log commit ca52fe090e6dbf1b6aa6ee51c3283efbe7549904 Author: User <myemailaddress> Date: Sat Jun 23 19:22:05 2012 -0400 project files
I followed github directions best that I could. What am I doing wrong?
After your Github repository has been created (i.e. you can view it on Github), then you should already have:
git init
touch README.md git add README.md git commit -m 'first commit'
origin
linked to your repository:git remote add origin https://github.com/username/repo.git
git push -u origin master
If you can view your repository on Github, then it has been successfully created. In this case it looks like you may have edited your README file on Github using the online editing tools, which caused your remote and local branches to diverge.
Before you can push
your local changes to Github, you need to fetch
or pull
your remote changes, merge the changes locally (merging is automatic with pull
), and then push
to the remote.
See Pro Git: Fetching and Pulling from Your Remotes
When you created the repository on GitHub you selected initializes remotely containing a README.md file. The next step would be to run git clone https://github.com/username/repo.git
in your terminal. At this point you have a local copy on the GitHub repository, so you would then move in your project files. Run git add *
then git commit -m 'first commit'
then git push origin master
. Your changes should now be visible on GitHub.
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