Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Struggling with git, cannot push to new remote repository

Ok, hopefully this should be easy for you. I'm new to git, BitBucket and somewhat new to version control too, I'm going to be missing something obvious to you.

So here's what I've done: I've installed git on my machine and set my globals. Set up a new repo on BitBucket. Then:

$ git clone https://[me]@bitbucket.org/[me]/[my_project].git

I create a new file (index.html) locally, add and commit:

$ git add index.html 
$ git commit -m "Initial commit."
  [master (root-commit) 01d4120] Initial commit.
  1 files changed, 164 insertions(+), 0 deletions(-)
  create mode 100755 index.html

Committed successfully.

$ git push
  Password: 
  Everything up-to-date

I enter my password aaaaaand... Everything up-to-date... It doesn't push. I just want to push straight to the remote trunk from my local trunk.

I'm sorry if this is really obvious but I'm so new to everything I can't seem to find any info, I was just working through the 'BitBucket 101' steps. Cheers.

like image 873
igneosaur Avatar asked Oct 26 '11 20:10

igneosaur


2 Answers

You will have to do:

git push origin master

Change origin if you have a different remote.

Change master if you have different branch.

like image 119
manojlds Avatar answered Oct 24 '22 08:10

manojlds


I am not sure it is bitbucket.org or GIT's issue.

After you clone the project. In your local configuration, you have the origin setup to the remote. But no branch information yet. So you have to use '$ git push origin ' to do it once. After that. you can simply use '$ git push'.

'$git push -v ' would be helpful to find issue. It prints out detail information.

like image 44
Enze Chi Avatar answered Oct 24 '22 09:10

Enze Chi