move my root directories one level up in GitHub? - windows

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.

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

How to solve '.git/index.lock': No such file or directory' error?

Summary
I recently lost the ability to make any changes using Git on my Windows system. After a few days of not using my PC I come back to a non functional git so I have no idea what caused this issue.
Examples:
git add or git checkout => fatal: Unable to create 'dummy-repo/.git/index.lock': No such file or directory
git clone => fatal: could not create work tree dir 'DummyRepo': No such file or directory
As a side note, this problem occured after trying to start my Flutter application, which could not retrieve the packages because of an OS error where access was denied. I'm thinking this is either because of some write permissions being messed up or a certain process locking a file.
What I've tried so far:
Closing all files and rebooting PC
Uninstalling and reinstalling Git
Run Git Bash as an administrator
Changed system write permission to my user account for all files
Any help is appreciated!
On Windows, this may happen if you enabled the "Ransomware protection" in Setting > Windows security > Virus & threat protection.
You need to add an exclusion for git.exe, or move the project outside a protected folder.
I've solved it myself by changing the location of my project to C:\ instead of a way longer path. This was never a problem before but it works so I'm happy.
I did 2 things:
I found that there was a file named 'index' in '.git/' directory. I made a copy of it, and renamed the copy as 'index.lock'.
Under 'Ransomware protection', I temporarily switched off 'Controlled folder access'.
Problem solved.
After I am done, I switched 'Controlled folder access' back on.
Try creating that file in your .git directory, you can use these commands in Git Bash or linux/mac
cd .git
touch index.lock
On Windows CMD
cd .git
type nul > index.lock

'git add .' affecting line feeds of files outside .git folder

I've got a series of HTML pages and other files for a website hosted on heroku sitting under a folder named 'sitename' on the User level of my computer - Windows 8 64 bit (that is, the files are in 'C:\Users\Me\sitename'
I'm trying to deploy them to the site using this code:
$ git add .
$ git commit -am "make it better"
$ git push heroku master
When I execute '$ git add .', the console starts returning tons of messages naming certain files and saying 'The file will have its original line endings in your working directory. warning: LF will be replaced by CLRF'.
Reading the question here, I found that it probably wouldn't affect anything in my code. However, when I run the code, it doesn't just affect the files in my git repository (which I think is set up correctly by running '$ git init', which creates a .git folder on the same level as the sitename folder), but starts to affect files in my AppData folder, e.g. iTunes.
Is this expected behavior? Will it affect anything? And is there a way to direct 'git add' towards only the repository?
I would recommend investigating where your git folder really is for your project first. Because it seems like you have somehow added files from the Appdata folder to your project, this indicates that the git folder you have created is not seperated from the other folders on the server. For example you have your git folder in:
'C:\Users\Me' instead of 'C:\Users\Me\sitename'
To easily see what files that have been added to your git project/Hasn't been added you can execute the command:
git status
This will also show your current staged files and if you have commited something.
To add single files/folder just write:
git add example.html
Where example is the name of the file you want to add (it can be any extension).
To remove files just do the same but use git rm.

How to delete folder with 'illegal' name in SVN via Tortoise (Windows)

Somehow, and I have no idea how, I have managed to create a folder in our SVN repo called "C:"
This is preventing me from updating my working copy - I get the error
'.' is not valid as filename in directory 'C:\SVN'
All the actual files/folders are all greenflagged, indicating everything is up to date, the bolded line indicating my working copy revision in the log is not at the top - which is very annoying - and may happen to other developers if I don't' fix the repo.
The folder as displayed in the repo browser is empty. When I try to delete the folder in the Tortoise repo browser I get
Unable to connect to a repository at URL
'svn://10.151.0.107/svn_repository/source/C:'
Can't open file '\svn_repository\source\C:\format': The filename, directory
name, or volume label syntax is incorrect.
How can I delete this folder?
The answer is provided at SuperUser at https://superuser.com/questions/165395/how-to-delete-invalid-files-with-colon-in-their-name-under-windows
It could be that you've created the path using Subversion client in the past. Subversion allows special characters in the repository while Windows does not. I can advise removing this C: directory from the latest revision using the command:
svn del "svn://10.151.0.107/svn_repository/source/C:" -m "Removed folder with invalid name"

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