I am following Django For Beginners and attempting to complete the chapter two exercise, part of which is setting up and loading my project to Bitbucket. I can't get it to work, I've tried several different things, researched other issues and can't make it happen. Any help, advice and/or assistance will be greatly appreciated. Here's what the book instructs me to do and what I get:
PS C:\helloworld> git remote add origin https://username@bitbucket.org/username/hello-world.git
fatal: remote origin already exists.
PS C:\helloworld> git push -u origin master
remote: Not Found
fatal: repository 'https://username@bitbucket.org/username/hello-world.git\/' not found
PS C:\helloworld>
Hi Mikael!
I'm editing my response from earlier. Upon further examination, I still don't think I have properly uploaded my project to Bitbucket. All I seem to have in the repository is a README.md document. I am adding another image to this reply. Thank you again for your help!
Steve
Thank you VERY MUCH for your quick response!
Yes, I've attached a screen image.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, so try and update the URL. In Bitbucket click into your repository, click Clone and copy the URL. Then from within your repository locally run this command:
git remote set-url origin <URL copied from Bitbucket>
You can then run
git remote -v
Verify that the URL looks correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Mikael!
I think that did it!
Here's a screen shot of the Download repository:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you open the hello-world repository. There must be a command with the correct origin url.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Alexey!
I have attached a screen print image of the hello-world repository. All that is in there is README.md.
Your advice will be greatly appreciated!
Thanks!
Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On your local machine inside the repository, run
git remote -v
Verify that the URL looks correct. You can always click on Clone in Bitbucket and copy the URL from there and change it on your local repository by running
git remote set-url origin <URL copied from Bitbucket>
Also, make sure you have committed your local changes to the repository by running
git status
If all your changes are committed it should say something like this
$ git status
On branch bugfix/CR-234-fixing-somthing
Your branch is ahead of 'origin/bugfix/CR-234-fixing-somthing' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
In the example above my local copy of the branch has two commits that have not yet been pushed to Bitbucket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mikael!
Thank you, again.
This is what I get after running git status:
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
hello-world/
nothing added to commit but untracked files present (use "git add" to track)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Steven Jones Okay, so you have not committed your changes to the repository yet, that is what the untracked files means. If you run
git commit -am "your commit message"
This will combine git add and git commit, and once you have run this command you can run git push to push your local changes back to Bitbucket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's what I get:
PS C:\sdj\programming\django\DjangoForBeginners\helloworld> git commit -am "Commit 070618 14:55"
On branch master
Untracked files:
hello-world/
nothing added to commit but untracked files present
PS C:\sdj\programming\django\DjangoForBeginners\helloworld> git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
PS C:\sdj\programming\django\DjangoForBeginners\helloworld>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll need to add the files to git before committing them:
git add hello-world
This will tell git to start tracking the file named "hello-world". You can also list multiple files or use wildcards if that'd be faster.
Once git knows to track "hello-world", then you can commit:
git commit -am "put a useful commit message here"
And once you've committed, you can push:
git push --set-upstream origin master
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.