Hi, I created a repository and I didn't forget to add *.war and *.java to .gitignore file. Now the repository hava growth and my .git file is about 500 megabytes. I search and test some solution and they aren't working for me. I don't want solution to solve the problem. I want to clean problem. I think the best solution is remove all histories of source code of repository and . [ Because it's a team repository, I can't create a new repositories and I don't want to anybody pay to my bad work].
We have a guide to doing this if you simply want to scrub out specific files. Read over the document here. If you are looking to start over. You can simply copy all of your current files over to a new directory without the .git or .hg directory and do:
git init
Then, create/adjust your ignore file and then re-add all your data with:
git add -A
Then you can commit
git commit -m "Some commit message"
And then push your content up to Bitbucket again.
git push -u origin master
Thank you Marcus,
git push origin +master
Also the above worked for me. What is difference between origin +master and -u 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.
I did that and then it says me :
error: src refspec master does not match any.
error: failed to push some refs to 'https://x@bitbucket.org/y/x-y-z.git'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've updated my comment to include more full instructions.
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.