GitHubにアクセスしてレポを設定するための本当のシンプルなPerlスクリプトを書きましたが、私は>>fatal: 'origin' does not appear to be a git repository
エラーを受け取ります。'origin'はgitリポジトリではないようです。 '
洞察力があれば幸いです。
#!/usr/bin/perl
use 5.006;
use strict;
#use warnings
my $file;
my $dir;
my $user;
my $email;
my $repo;
print ("Enter your user name\n");
$user = <STDIN>;
chomp $user;
print ("\nEnter your email address\n");
$email = <STDIN>;
chomp $email;
print ("\nEnter a directory path..\n");
$dir = <STDIN>;
chomp ($dir);
sub openDIR{
if (opendir(DIR, $dir)) {
chdir $dir;
print ("You are now in directory >>> ", $dir, "\n");
system 'touch README';
system 'ls -l'
} else {
print ("The directory can not be found, please try again");
die;
}
}
sub git{
print ("Enter the name of the repo you created on Git Hub.\n");
$repo = <STDIN>;
chomp $repo;
system 'git config --global user.name', $user;
system 'git config --global user.email', $email;
system 'git init';
system 'git add README';
system "git commit -m 'first commit'";
system "git remote add origin git\@github.com:", $user,"/", $repo, ".git";
system 'git push origin master'
}
openDIR();
git();
リポジトリを追加した後にプログラムを停止して、実際に追加されているかどうかを確認してください。 – lc2817
[Git :: Wrapper](http://search.cpan.org/perldoc/Git::Wrapper)を試してください。 –