Make.git open in ssh - ssh

I have download a git with a wget on a vps through putty.
I see the file is listed on the vps like so:
bitcoin-sniffer.git .lastlogin .python_history
Now how can I execute the .git, or actually use the files that are within it? I have tried
git clone bitcoin-sniffer.git
The error:
fatal: destination path 'bitcoin-sniffer.git' already exists and is not an empty directory.

Generally, the git clone command is followed by an address with ssh or HTTPS path to download a repo. The git command is not run against a *.git "package".
An example would be:
bash
git clone https://github.com/sebicas/bitcoin-sniffer.git
This would download and create a folder by the name bitcoin-sniffer. Within this folder, git commands can be run, like git status.

The "git" you acquired is a full git repository, with the entire history of the protect and all the information you need to get the current state of the files. Judging by the .git extension, I would assume that the repository is "bare", meaning that it only contains the compressed history but not a working copy of the current state of the project. Conventionally, bare repos have a .git extension, while a full working copy would have a .git folder in the project root.
Your intuition to clone the repository to get a working copy is correct. It's not working because by default, git clone running locally will try to make a folder with the same name as the repo. Give it a different folder name as an additional parameter instead:
git clone bitcoin-sniffer.git bitcoin-sniffer
This is actually doing an extra step in all probability. You can clone directly from a remote location using either SSH or HTTPS. If your project comes from GitHub, for example, you can get a read-only copy (that you can modify locally but not push back) anonymously over HTTPS:
git clone https://github.com/sebicas/bitcoin-sniffer.git
You really shouldn't be getting "gits" using WGET under normal circumstances.

Related

Error when cloning a svn repository using git-svn

I am trying to migrate a SVN repo to a git. For this I am using git-svn tool. I'm running the command:
git svn clone [SVN repo URL] --no-metadata -A authors-transform.txt --stdlayout ~/temp
and I'm getting the following error:
Name does not refer to a filesystem directory: Can’t get entries of non-directory at /Applications/Xcode.app/Contents/Developer/usr/share/git-core/perl/Git/SVN/Ra.pm line 312.”
Line 312 of that script is:
$reporter->finish_report($pool);
So I understand that finish_report is failing, but I don't understand why.
That particular section in perl/Git/SVN/Ra.pm is seven years old and part of the initial split of git-svn.perl
Try instead subgit (in its free version, for a one-shot import): it should be more robust.

When I try to add local repository as per the tutorial, it gives me error as 'this directory does not appear to be a Git repository'

I want to upload my project to GitHub account. When I try to add local repository as per the tutorial, it gives me error as 'this directory does not appear to be a Git repository'
enter image description here
You need to initialize repository first. You can do it by running command below in your terminal.
git init
Basically you need to follow these steps.
First initialize the git in a specific folder.
git init
Then take the https or ssh link of the github repository and add as a remote.
git remote add origin master [url of repository]
Then need to add all files or folders
git add -A
It will add all the files and folders of the project.
If you want to know the status of it that which files and folder are going to be upload
git status
Then you need to commit and write the message
git commit -m "first commit"
Then you need to push all this.
git push origin master

How to build docker image from github repository

In official docs we can see:
# docker build github.com/creack/docker-firefox
It just works fine to me. docker-firefox is a repository and has Dockerfile within root dir.
Then I want to buid redis image and exact version 2.8.10 :
# docker build github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
2014/11/05 16:20:32 Error trying to use git: exit status 128 (Initialized empty Git repository in /tmp/docker-build-git067001920/.git/
error: The requested URL returned error: 403 while accessing https://github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/info/refs
fatal: HTTP request failed
)
I got error above. What's the right format with build docker image from github repos?
docker build url#ref:dir
Git URLs accept context configuration in their fragment section,
separated by a colon :. The first part represents the reference that
Git will check out, this can be either a branch, a tag, or a commit
SHA. The second part represents a subdirectory inside the repository
that will be used as a build context.
For example, run this command to use a directory called docker in the
branch container:
docker build https://github.com/docker/rootfs.git#container:docker
https://docs.docker.com/engine/reference/commandline/build/
The thing you specified as repo URL is not a valid git repository. You will get error when you will try
git clone github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
Valid URL for this repo is github.com/docker-library/redis. So you may want to try following:
docker build github.com/docker-library/redis
But this will not work too. To build from github, docker requires Dockerfile in repository root, howerer, this repo doesn't provide this one. So, I suggest, you only have to clone this repo and build image using local Dockerfile.
One can use the following example which sets up a Centos 7 container for testing ORC file format. Make sure to escape the # sign:
$ docker build https://github.com/apache/orc.git\#:docker/centos7 -t orc-centos7

Capistrano error when change repository using git

I have a simple deployment via capistrano from a Git repository.
I wanted to change the repository I was working with so I basically just changed
set :repository, "git#github.com:new_repository"
But i get the following error when deploying:
fatal: Could not parse object '9cfb...'.
The problem goes away once I change
set :deploy_via, :remote_cache
to
set :deploy_via, :copy
I also tried deploy:cleanup but I get the following error:
*`deploy:cleanup' is only run for servers matching {:except=>{:no_release=>true}}, but no servers matched*
Any idea how could i get remote_cache working again?
Thansk!
With capistrano 3, to avoid deleting the repo folder :
Change the repo URL in your config/deploy.rb, as the OP already did
SSH to your server inside and change the remote URL of the git repo :
ssh user#server.com
# Go the capistrano deploy root
cd /capistrano/deploy/root/folder
# Go inside the folder names *repo*
cd repo
# Manually change the git remote
git remote set-url origin ...
Capistrano < 3
Fix it in ./shared/cached-copy/.git/config from deployment folder of your server.
OR ugly way do this:
Remove the shared/cached-copy from deployment folder of your server.
Capistrano > 3
Fix it in ./repo/config from deployment folder of your server.
Learn How to fix similar issues
It is caused as your server files are referring to old repo so you have to find and fix it.
Do this to find matches in files:
cd /path/to/your/project
grep -r OLD_REPO_NAME ./
Now you see all files including your OLD_REPO_NAME .
If they are matched in your release folder or current, you dont need to care for fixing them. But you should fix all configs.
you can just change the git url in
shared/cached-copy/.git/config
Additional info for Capistrano 3 users. Capistrano will create a folder repo. So the structure looks like this:
current -> /var/www/preview/releases/20140612212305
releases
repo
revisions.log
shared
When you change the :repo_url in deploy.rb you can safely remove the repo folder and run the deployment. The folder will be created again. The reason why you have to do this step is because in repo/config is the old remote url.
ssh to your production server and delete the content of your shared/cache folder. The git ref stored in there is not valid anymore so it won't work.
Just add task into deploy.rb to sync it automagically.
$ cap admin:fix_repo
namespace :admin do
desc 'Fix repo'
task :fix_repo, :roles => :web do
run "cd #{shared_path}/cached-copy && git remote set-url origin #{repository}"
end
end
As related to this thread, after updated your deploy.rb with
set :repository, "git#github.com:new_repository"
go to your server with ssh deploy-user, then cd Old_repository/repoand sudo vim config
You'll find the line
url = git#github.com:username/old_repository.git and you have to rename it with url = git#github.com:username/new_repository.git
Don't forget to delete the Old_repository folder on your server, or just rename it before in New_repository folder !

How To Upload Files on GitHub

I have recently downloaded GitHub and created a repository on it. I am trying to upload an Objective C project in it. How do I go about doing this?
I didn't find the above answers sufficiently explicit, and it took me some time to figure it out for myself. The most useful page I found was:
http://www.lockergnome.com/web/2011/12/13/how-to-use-github-to-contribute-to-open-source-projects/
I'm on a Unix box, using the command line. I expect this will all work on a Mac command line. (Mac or Window GUI looks to be available at desktop.github.com but I haven't tested this, and don't know how transferable this will be to the GUI.)
Step 1: Create a Github account
Step 2: Create a new repository, typically with a README and LICENCE file created in the process.
Step 3: Install "git" software.
(Links in answers above and online help at github should suffice to do these steps, so I don't provide detailed instructions.)
Step 4: Tell git who you are:
git config --global user.name "<NAME>"
git config --global user.email "<email>"
I think the e-mail must be one of the addresses you have associated with the github account. I used the same name as I used in github, but I think (not sure) that this is not required. Optionally you can add caching of credentials, so you don't need to type in your github account name and password so often. https://help.github.com/articles/caching-your-github-password-in-git/
Create and navigate to some top level working directory:
mkdir <working>
cd <working>
Import the nearly empty repository from github:
git clone https://github.com/<user>/<repository>
This might ask for credentials (if github repository is not 'public'.)
Move to directory, and see what we've done:
cd <repository>
ls -a
git remote -v
(The 'ls' and 'git remote' commands are optional, they just show you stuff)
Copy the 10000 files and millions of lines of code that you want to put in the repository:
cp -R <path>/src .
git status -s
(assuming everything you want is under a directory named "src".) (The second command again is optional and just shows you stuff)
Add all the files you just copied to git, and optionally admire the the results:
git add src
git status -s
Commit all the changes:
git commit -m "<commit comment>"
Push the changes
git push origin master
"Origin" is an alias for your github repository which was automatically set up by the "git clone" command. "master" is the branch you are pushing to. Go look at github in your browser and you should see all the files have been added.
Optionally remove the directory you did all this in, to reclaim disk space:
cd ..
rm -r <working>
Well, there really is a lot to this. I'm assuming you have an account on http://github.com/. If not, go get one.
After that, you really can just follow their guide, its very simple and easy and the explanation is much more clear than mine: http://help.github.com/ >> http://help.github.com/mac-set-up-git/
To answer your specific question: You upload files to github through the git push command after you have added your files you needed through git add 'files' and commmited them git commit -m "my commit messsage"
You need to create a git repo locally, add your project files to that repo, commit them to the local repo, and then sync that repo to your repo on github. You can find good instructions on how to do the latter bit on github, and the former should be easy to do with the software you've downloaded.
To upload files to your repo without using the command-line, simply type this after your repository name in the browser:
https://github.com/yourname/yourrepositoryname/upload/master
and then drag and drop your files.(provided you are on github and the repository has been created beforehand)
Here are the steps (in-short), since I don't know what exactly you have done:
1. Download and install Git on your system: http://git-scm.com/downloads
2. Using the Git Bash (a command prompt for Git) or your system's native command prompt, set up a local git repository.
3. Use the same console to checkout, commit, push, etc. the files on the Git.
Hope this helps to those who come searching here.
if you're on windows:
http://windows.github.com/
otherwise:
http://git-scm.com/downloads/guis
If you want to upload a folder or a file to Github
1- Create a repository on the Github
2- make: git remote add origin "Your Link" as it is described on the Github
3- Then use git push -u origin master.
4- You have to enter your username and Password.
5- After the authentication, the transfer will start