Reputation: 115
Well, maybe someone asked this before, excuse me if I ask it again.
I was working my thesis for a long time stored in a directory within Dropbox.
Now for the revisions I'm receiving helping from some people, and since all this was generated in LaTeX, a repository in git is a good idea. I have to confess that I'm quite new using it.
So I opened an account inside Bitbucket for store a remote repository from my project (thesis) and ease the revisions and other changes.
I tried to follow the instructions for create the repository, but I make a mistake, the step I followed were:
$ echo "Aradenatorix Veckhom Vacelaevus" >> contributors.txt
$ git add contributors.txt
$ git commit -m 'Initial commit with contributors'
$ git push -u origin master
I did the first 3 lines, but then I saw it was unnecesary becase they was the instructions for create my first file, commit and push, but I have yet a lot of files from the project. The right steps are:
cd /path/to/my/repo
git remote add origin https://[email protected]/Aradenatorix/tesis.git
git push -u origin --all #
git push -u origin --tags #
The firs one I did before so I have no troubles with that, instead of follow the 4th step from the wrong instructions before, I did the second one from this, but when I tried the third I had an error:
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
However I don't need to add all the content of the directory, only the .tex
files and a subdirectory with the attached pictures. After explaining the above I have two doubts:
$ git init
but... How to stop it?I tried with $ git rm
and many options such as --dry-run
, --cached
, -r
and --ignore-unmatched
but nothing works yet.
Thanks in advance
Upvotes: 0
Views: 254
Reputation: 3346
Assuming you would have made just a couple of commits. You can recreate the commit.
git reset HEAD~<number of commits>
rm path/to/unnecessary/file
Add new files which were not previously added (optional):
git add new/files
git commit
To get the number of commits (which should probably be 1 or 2 in your case),
git rev-list HEAD --count
Finally, do a force push.
git push origin master --force
This option should be used only if your repo is not shared with other people and you know what you are doing. You will overwrite the remote. All you remote changes will be overwritten by the local changes.
As you mentioned, it is a fresh repository and you haven't used version control for your project before. So I think you can go ahead with it.
Upvotes: 1