Adding layer to mercurial directory - terminal

I have a Mercury repo and I need to rename a directory from /animal/dog/ to /animal/mammal/dog/. So I did
hg rename /animal/dog/ /animal/mammal/dog/
But I get an error that says
abort: destination /animal/mammal/dog/ is not a directory
How do I make it work?
The above steps is what I've tried.

I was able to solve the problem. It turns out I'm not allowed to use relative paths. Once I changed to absolute path, it worked.

Related

cloned github repo into wrong path

hello everyone I am new to Linux and of course bash by default. I have set up an Amazon light sail server, I am using the LAMP stack and to my knowledge, it doesn't have a GUI, so I had to use bash over SSH., not the end of the world except for I made a bit of a mistake and don't even know what to google.
I was trying to clone a Github repo into my htdocs folder. the problem is that I didn't cd into the folder first. the following
bitnami#ip-xxx-xx-x-xxx:~$ git clone https://github.com/myaccount/folder.git .
fatal: destination path '.' already exists and is not an empty directory.
when I read this I realised what I did, then I cd'ed into the right directory and did deleted everything in there with the rm -rf * command. when I checked my webserver I knew something was wrong. instead of a blank index of/ page, like normal it had a git item in it.
I then ran the command again to be sure, but it was still there.
I tried looking around within the file tree but I cannot find an extra or out of place git folder and would have no idea how to undo what I did.
when I run it properly it says:
bitnami#ip-xxx-xx-x-xxx:/opt/bitnami/apache2/htdocs$ git clone https://github.com/myaccount/folder.git .
fatal: destination path '.' already exists and is not an empty directory.
thank you for your time

move my root directories one level up in GitHub?

I set up my Github directory the way that one extra folder contains the server folder.
is there a way to move my entire directory one level up in Github?
I tried "git mv repo.git/webapp/* repo.git/." with gitbash
it sends a fatal: bad source error.
thanks for your help.

.gitignore_global ignored wrong dir and won't allow it to be tracked after removal

I accidentally added Laravel's app/storage dir to .gitignore_global. This caused problems of course, so I removed it from .gitignore_global.
Now no matter what I can't get any project to track app/storage or any of its subdirectories.
I've checked all .gitignore files for my projects and none mention "storage".
I tried running git add storage -f but this caused all .gitignore files in all the subdirectories to be ignored, which is not what I want since some files should not be added. If I just run git add storage, I get the error
The following paths are ignored by one of your .gitignore files: app/storage
What's going on here?
(For information, I'm running on Mac OS 10.9.)
Try git check-ignore -v for some file in there, it doesn't even have to exist. That's always been very effective for me.

Git (windows 7) won't add directories, but adds files files typed explicitly

trying to find an answer to this, have seen it hinted at, but no solution.
Not entirely new to git, but haven't used it in a few months... this is my first time using it on windows. using git bash.
I have a cake PHP site that I want to add exluding any cache files my .gitignore file contains only:
app/tmp/*
Here is the most basic thing I have tried:
git init
git add .
git commit
I get a message on commit saying there are untracked files - all files and dirs at the root directory.
git status
gives me the same message.
However, if I type
git add .htaccess
it stages the .htaccess file.
Also, if I do:
git add app/.htaccess
It will add that file too.
I have also tried
git add app/*
no luck.
Thanks in advance.
The files aren't ignored, because otherwise you would be forced to do a git add --force afile.
However, you might want to check GIT_DIR and GIT_WORK_TREE environment variable, and see if they reference another repository, which could explain the discrepancy between the index and what you think is your working tree.

Subversion control No Such file or directory. Can't open file

Error message :
"svn: Can't open file '/Users/username/Projects/myproject/trunk/project/.svn/text-base/filetoupdate.h.svn-base': No such file or directory"
Question:
I have an issue I've replaced a file in a project (in Xcode) with a new file (For reference and if this makes a difference, the new file has the same name as the one I deleted previously).
Now when I try to commit my changes in Xcode I get the error message detailed above and am unable to commit the changes (i.e. adding the new file).
In the file system view (in Xcode on the left hand side of the screen) the file has an R next to it (indicating Replaced in the repository).
Does anyone know how to fix it so I can commit the files?
Thanks
There is a bug or limitation in Subversion when using case-insensitive filesystems:
https://superuser.com/questions/303348/cant-checkout-in-subversion
This bug normally shows up when checking out a repository that contains two files whose names differ only in case. Of course, these cannot exist at the same time in the same directory on a case-insensitive filesystem. SVN could give a much more helpful error message, but it can't really solve the problem.
Your issue is a bit different because I assume the file filetoupdate.h (with the old case) no longer exists in your filesystem. So it's not a case conflict in the working directory. But I guess that SVN is trying to create the file in .svn/text-base with the new case, while the old one still exists, and that is failing (for the same reason).
You could try deleting the file from Subversion first, keeping the local copy (untested). The new copy must be removed from SVN control for the commit to succeed:
svn rm --keep-local --force FileToUpdate.h
And the old copy must be removed as well, to allow us to add the new copy later:
svn rm --keep-local filetoupdate.h
Commit this change:
svn commit
Now hopefully you can add the new file to version control:
svn add FileToUpdate.h
If that doesn't work, you might need to blow away the whole checkout and start again with a fresh one.
Are you on a Mac or Windows? Those have case-insensitive filesystems which causes the above problem when
a file currently exists with the same name but with different cases.
To fix , checkout out the tree on a Linux machine, then "svn rm" one of the files.
Maybe your local version has permission issues. Check if your user have the permissions to write for the .svn directories.
good luck
It looks like something got confused somewhere. To fix, I simply copied the offending files, saved them under a new name. Removed the originals from the project and the added the copied (renamed) version of the file to the project.
It seems to be that SVN doesn't like it if you add and remove a file with the same name. I tried cleaning the SVN through terminal, but it had no affect on this issue. But changing the name did work for me.

Resources