Nothing changed (missing files, see hg status) when comitting - version-control

I mapped to a drive an ftp, I went and did hg init
then added a file, did hg add then hg commit -u username -m 'message'
I am getting the message nothing changed (2 missing files, see hg status)
hg status return this:
X:\public_html>hg status
A .htaccess
A index.html
I can't seem to find someone else remotely close to my problem and official doc didn't help me either.
I'm out of ideas, every bit of information is appreciated.

It seems incredibly unlikely this is going to work on a FTP mapped drive. Version control systems rely on coherent filesystem primitives (lock counts, etc.) that your mapping software likely doesn't fake correctly enough. Mercurial has its own protocol for moving changes to/from a computer (push and pull over HTTP or SSH) and that's the right way to get stuff to and from the machine on which the FTP server is running.
That said, you might have a small bit of luck with:
hg commit -u username -m 'message' .htaccess index.html
if the problem is commit not detecting the files as modified/added.
It looks like the server you're FTPing to/from is a linux box, so it's already running sshd. That means you can clone to it with:
hg clone c:\localclone ssh://you#there//full/path/to/repo
and can push/pull from that URL as well.

Related

Managing multiple GIT ssh keys

Having some issues with maintaining too many SSH keys in the same computer lately.
I have created two SSH keys in my computer for UserA(Company) and UserB(Personal). Both the ID's are created using different email ID
I am able to pull and push the code changes for UserA
But UserB is where I face trouble to push my code.
I am able to pull the code for UserB(Where repo is different than UserA)
While pushing the code I get the following error
ERROR: Permission to UserB/xxxxxx.git denied to UserA.
Please make sure you have the correct access rights
and the repository exists. ```
Feel bit strange to me. Can someone help me this ?
Starting from Git 2.3.0 you can use below command
GIT_SSH_COMMAND='ssh -i private_key_file' git clone user#host:repo.git
Solved !!
Created Gitconfig for personal and work using the following link,
https://medium.com/#trionkidnapper/ssh-keys-with-multiple-github-accounts-c67db56f191e
Sometimes you have the problem of too many keys stored in the ssh-agent.
Then the server refuses the connection after it offering too many keys.
This can be solved by force ssh to use only one specific key.
GIT_SSH_COMMAND='ssh -o IdentityAgent=none -i private_key_file' git <cmd>

How have I saved Gitlab username and password in Visual Studio Code, Windows?

This is a strange question, but I cannot find how I did this:
I have three computers, all of them with visual studio code and an account in gitlab. In two of them, my operation has been
git clone ___.git
cd folder
git init
git remote add origin ___.git
And then, every time I push,... I have to enter my id and pass.
But in my first computer, I did something that I don't need to enter the id and pass anymore, it just pushes without hassle.
Then, I thought I must have done something like this
https://git-scm.com/docs/git-credential-store
But when I look for .gitconfig, which I find in the /Users folder, there I only have my user.name (which is not the one of gitlab), the email (this one is the gitlab email) but no password entry. And I cannot find any other .gitconfig files anywhere. For sure I didn't set up any SSH key.
So here the question, what did I do?
Make sure to use the GCMfW: Git-Credential-Manager-for-Windows:
git config --global credential.helper manager
Then try again: that should cache your username / password, provided you are using an HTTPS (https://...) URL, not an SSH one.

make server backup, and keep owner with rsync

I recently configured a little server for test some services, now, before an upgrade or install new software, I want to make an exact copy of my files, with owners, groups and permissions, also the symlinks.
I tried with rsync to keep the owner and group but in the machine who receives the copy I lost them.
rsync -azp -H /directorySource/ myUser#192.168.0.30:/home/myUser/myBackupDirectory
My intention is to do it with the / folder, to keep all my configurations just in case, I have 3 services who have it's own users and maybe makes modifications in folders outside it's home.
In the destination folder appear with my destination user, whether I do the copy from the server as if I do it from the destination, it doesn't keep the users and groups!, I create the same user, tried with sudo, even a friend tried with 777 folder :)
cp theoretically serves the same but doesn't work over ssh, anyway I tried to do it in the server but have many errors. As I remembered the command tar also keep the permissions and owners but have errors because the server it's working and it isn't so fast the process to restore. I remember too the magic dd command, but I made a big partition. Rsync looked the best option to do it, and to keep synchronized the backup. I saw rsync in the new version work well with owners but I have the package upgraded.
Anybody have some idea how I do this, or how is the normal process to keep my own server well backuped, to restore just making the partition again?
The services are taiga, a project manager platform, a git repository, a code reviewer, and so on, all are working well with nginx over Ubuntu Server. I haven't looked other backup methods because I thought rsync with a cron job do the work.
Your command would be fine, but you need to run as root user on the remote end (only root has permission to set file owners):
rsync -az -H /directorySource/ root#192.168.0.30:/home/myUser/myBackupDirectory
You also need to ensure that you use rsync's -o option to preserve owners, and -g to preserve groups, but as these are implied by -a your command is OK. I removed -p because that's also implied by -a.
You'll also need root access, on the local end, to do the reverse transfer (if you want to restore your files).
If that doesn't work for you (no root access), then you might consider doing this using tar. A proper archive is probably the correct tool for the job, and will contain all the correct user data. Again, root access will be needed to write that back to the file-system.

How do I clone Github data to Amazon EC2?

I am new to both Git and Amazon EC2.
I want to clone my Github code to Amazon EC2 directly.
For that I have referred to the following URLs:
http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/
http://deductiveblog.in/2013/05/19/deploy-to-amazon-ec2-using-git/
How to push to git on EC2
I've performed the necessary changes suggested in the above URLs, but am still not able to get my data on Amazon EC2.
By following the above suggested steps, I can see one directory - but it does not display the data in it that I have in git & in my local.
So what should I do to clone all data in Amazon EC2?
I also want to know one other thing - is it possible that I can put my files directly in /var/www directory without creating .git?
Now in this, I am getting an error Permission denied (publickey). Fatal the remote end hung up unexpectedly.
For that I have checked my ssh keys as well and add it to github. I have a file authorized_keys for key and I have added the same key in github, but still it gives me a Permission denied error.
Can anyone give any suggestions how to resolve this?
You can just use the git clone command from your ec2 instance from the directory you want the repo cloned to.
git clone git://github.com/ryanb/railscasts-episodes.git
of course you need to alter the url part to your repo, this will create a folder with the files inside named after the repo in the current directory. If you want to clone the files inside the repo into the current directory do:
git clone git://github.com/ryanb/railscasts-episodes.git .
The Full Stop (.) or dot indicates the current directory in Unix.

svk checksum mismatch

I've been using SVK without any issues the last 6 months. I then attempted to commit a file, when the following error occurred:
%> svk commit -m "Message" foo/bar/file.txt
Commit into mirrored path: merging back directly.
Merging back to mirror source file:///usr/local/svn/repo.
A checksum mismatch occurred: Base checksum mismatch on '/trunk/foo/bar/file.txt':
expected: 9e421f7db5c4c0d6796c90524456d7f4
actual: ed4e76ccf3e54223908179735ecf1e89
Anyone know how to resolve this issue?
Just needed svk up -s, answer found here:
Working with SVK in a multi-user environment
... svk up is
not enough to ensure that your depot
reflects the latest changes in the
remote repository. Instead you must
perform an svk sync (see svk help sync
for information about options) to
bring the local depot up to date, or
pass the -s switch to svk up to
achieve the same effect ...
# alternative 1:
svk sync //mirrors/mirrored_repo_name
svk up
# alternative 2:
svk up -s