小编eis*_*ati的帖子

使用暂存区域中的未提交文件撤消git reset --hard

我正在努力恢复我的工作.我愚蠢地做了git reset --hard,但在那之前我只做过get add .而且没做过git commit.请帮忙!这是我的日志:

MacBookPro:api user$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)

#   modified:   .gitignore
...


MacBookPro:api user$ git reset --hard
HEAD is now at ff546fa added new strucuture for api
Run Code Online (Sandbox Code Playgroud)

git reset --hard在这种情况下可以撤消吗?

git undo git-add git-reset git-commit

102
推荐指数
5
解决办法
5万
查看次数

外面的git checkout分支

问题:我需要以某种方式签出已经在我的文件系统上本地克隆的项目的现有分支,而不是在该项目的特定文件夹中.

解决方案:我正在尝试执行以下操作:

  1. git clone'github-project-url''file-system-folder'
  2. git checkout'indern-branch''file-system-folder'

我确实意识到第二步不是很正确,但我也试图避免使用"cd'file-system-folder'".

git branch clone git-checkout

31
推荐指数
2
解决办法
2万
查看次数

nginx php5-fpm失败(2:没有这样的文件或目录)

问题:我错过了什么或做错了什么?

我正在尝试使用php5-fpm将完全功能的Zend Framework应用程序从带有mod_php5的Apache2迁移到nginx.我遇到这种错误:

2012/06/27 12:08:04 [error] 1986#0: *1 open() "/var/www/public/sales/live-trials-json" failed (2: No such file or directory), client: *.*.*.*, server: www.mydomain.com, request: "POST /sales/live-trials-json HTTP/1.1", host: "www.mydomain.com", referrer: "https://www.mydomain.com/sales/live-trials"

这是我的配置文件:

a)/ etc/nginx/sites-enabled/www

server {
  listen 80;
  listen 443 default ssl;

  server_name www.mydomain.com;
  root /var/www/public;

  ssl_certificate /etc/nginx/ssl/mydomain.crt;
  ssl_certificate_key /etc/nginx/ssl/mydomain.key;

  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log error;

  index index.php index.phtml index.html;

  location = /(favicon.ico|robots.txt) {
    access_log off;
    log_not_found off;
  }

  location ~* ^.+.(css|js|jpeg|jpg|gif|png|ico|xml) {
    access_log off;
    expires 30d;
  }

  location / {
    try_files $uri …
Run Code Online (Sandbox Code Playgroud)

php ubuntu zend-framework nginx

14
推荐指数
2
解决办法
3万
查看次数

SQL SELECT*FROM tbl(隐藏1列)

我正在尝试这样做SELECT * FROM tbl,但是在20列中,我不希望选择1个特定列.有没有动态的方法呢?只是讨厌在查询中指定19列!

mysql sql sql-server select

4
推荐指数
1
解决办法
3万
查看次数

不允许使用Amazon EC2 Apache符号链接

我创建了一个Amazon EC2实例并在其上安装了Apache和PHP:

$ sudo yum install apache2
$ sudo yum install php
$ ls -al /var/www/services/
lrwxrwxrwx 1 root root   42 Jun 22 21:13 production -> /home/ec2-user/services
Run Code Online (Sandbox Code Playgroud)

我创建了新的VirtualHost:

<VirtualHost *:80>
    ServerName ec2-***.compute-1.amazonaws.com
    DocumentRoot "/var/www/services/production/public"

    <Directory "/var/www/services/production/public">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

现在,当我在浏览器中运行我的请求时,它说403 Forbidden并且日志显示符号链接问题:

[Wed Jun 22 21:14:19 2011] [error] [client ***] Symbolic link not allowed or link target not accessible: /var/www/services/production
[Wed Jun 22 21:14:20 2011] [error] [client ***] Symbolic …
Run Code Online (Sandbox Code Playgroud)

linux apache permissions symlink vhosts

2
推荐指数
1
解决办法
2955
查看次数

在mysql中拒绝某些查询

我无法在代码中找到触发查询的位置,并且想知道是否有一个mysql配置会在触发时拒绝该查询?例如,在我的情况下,它是UPDATE table SET col1 = NULL, col2 = NULL, col3 = NULL......请帮助!

mysql sql my.cnf

2
推荐指数
1
解决办法
1246
查看次数

从 Redshift 卸载到 S3 失败

我在 Redshift 中运行以下命令:

myDB=> unload ('select * from (select * from myTable limit 2147483647);')
       to 's3://myBucket/'
       credentials 'aws_access_key_id=***;aws_secret_access_key=***';
Run Code Online (Sandbox Code Playgroud)

这是我得到的回复:

ERROR:  S3ServiceException:The bucket you are attempting to access must be addressed
        using the specified endpoint. Please send all future requests to this 
        endpoint.,Status 301,Error PermanentRedirect,Rid 85ACD9FFAFC5CE8F,
        ExtRid vsz4/0NdOAYbaJ48WYCnrYBCvuuL0cBTdcEN

DETAIL:  
-----------------------------------------------
error:  S3ServiceException:The bucket you are attempting to access must be addressed
        using the specified endpoint. Please send all future requests to this 
        endpoint.,Status 301,Error PermanentRedirect,Rid 85ACD9FFAFC5CE8F,
        ExtRid vsz4/0NdOAYbaJ48WYCnrYBCvuuL0cBTdcEN
code:      8001
context: …
Run Code Online (Sandbox Code Playgroud)

mysql amazon-s3 data-dump amazon-redshift

2
推荐指数
1
解决办法
5305
查看次数

Redshift 插入多行

我正在努力将多行插入 Redshift 中。以下是 SQL 查询:

CREATE TABLE tblA (
  column1 bigint primary key,
  column2 varchar(255) default null,
  column3 varchar(255) default null,
  recordModifiedTimestamp timestamp
);

INSERT INTO tblA (column1, column2, column3) VALUES
  (1, "DES", "article"),
  (2, "DES", "slideshow"),
  (3, "DES", "video");
Run Code Online (Sandbox Code Playgroud)

当我运行最后一个查询时,我得到的结果如下:

ERROR:  column "des" does not exist in tblA
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

mysql sql postgresql amazon-redshift

0
推荐指数
1
解决办法
6495
查看次数