git log 예제

svn 2018. 3. 29. 11:01


https://github.com/adamfisk/LittleProxy를 clone해서 git log 예를 살펴본다.




git log


$ git log

commit 70edbe1c502d79449fb5ceb9d00cca6a0759d56f

Merge: ac8a466 1792fac

Author: adamfisk <afisk@bravenewsoftware.org>

Date:   Mon Sep 25 06:43:29 2017 -0700


    Merge pull request #388 from shs96c/guava-23


    Bump guava to version 23


commit 1792facf4799347b9ae841bd577917f4b0296fd7

Author: Simon Stewart <simon.m.stewart@gmail.com>

Date:   Thu Aug 17 22:21:02 2017 +0100


    Bump guava to version 23


commit ac8a466f6ca9db64efecbc72972502cfe6ec19d5

Merge: 47bee7b 9630e71

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 14:34:20 2017 -0800


    Merge pull request #355 from jekh/add-mitm-links-to-readme


    1.1.2 doc update & MITM links


commit 9630e71af4e5708ce87deb3d8b63a6a7b4a9019c

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 11:31:09 2017 -0800


    Added MITM links to readme


commit 47bee7b5e44b9ec514cd55be919aa3512abb74dc

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 11:07:19 2017 -0800


    [maven-release-plugin] prepare for next development iteration


commit f1ce0b6428bc86f1137a82ea6f9dae93a393f3c9

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 11:06:01 2017 -0800


    [maven-release-plugin] prepare release littleproxy-1.1.2


commit 27de86026edf4e1e86c9327a933237aae5a3a0bb

Merge: 070e6c1 31c19ff

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 10:51:47 2017 -0800


    Merge pull request #352 from jekh/dependency-updates


    Updated guava, dnsjava, slf4j, commons-lang, and test dependencies


commit 070e6c11574ebd1b0c2edb5f87421664d8b8db18

Merge: d1dffa8 08a36bc

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 10:47:37 2017 -0800


    Merge pull request #351 from jekh/fix-memory-leak-on-initial-request







너무 길어 한줄로..


$ git log --oneline
70edbe1 Merge pull request #388 from shs96c/guava-23
1792fac Bump guava to version 23
ac8a466 Merge pull request #355 from jekh/add-mitm-links-to-readme
9630e71 Added MITM links to readme
47bee7b [maven-release-plugin] prepare for next development iteration
f1ce0b6 [maven-release-plugin] prepare release littleproxy-1.1.2
27de860 Merge pull request #352 from jekh/dependency-updates
070e6c1 Merge pull request #351 from jekh/fix-memory-leak-on-initial-request
d1dffa8 Merge pull request #350 from luleyl/Keep-Alive_fixes
31c19ff Updated guava, dnsjava, slf4j, commons-lang, and test dependencies
08a36bc Fixing memory leak on initial request when HttpObjectAggregator is enabled
f816f3e Fix the repeated TimeOut response.
55fd04d Demonstrate that the TimeOut response is repeated.
43ee962 Merge pull request #349 from jekh/update-netty
a01674b Removed Transfer-Encoding portion of test due to change in netty behavior from netty PR#6270
f4fa693 Updated netty version to avoid false positive leak detection
2371cd7 Merge pull request #346 from jekh/allow-requests-to-origin-server
4ab9829 Added allowRequestsToOriginServer option to Bootstrap to allow handling origin-form requests
dfdb375 Merge pull request #343 from danielkyu/bug-format-accept-encoding-remove-sdch
6e0d253 Support for removing sdch encoding regardless of whether it is stored as a single/multi value
b92ed54 Merge pull request #334 from jekh/fix-invalid-client-request
faba98f Fixed test failure issue
7062538 Fixed bug where the 'Accept-Encoding' header could be improperly formatted after removing the 'sdch' encoding
b0792ae Responding with 400 and closing connection when client sends an invalid request
27dc4f4 Merge pull request #333 from jekh/update-docs
86e75d7 Update readme for 1.1.1 release
904aea3 [maven-release-plugin] prepare for next development iteration
098e16a [maven-release-plugin] prepare release littleproxy-1.1.1
7bf4483 Merge pull request #331 from jekh/remove-ossrh-parent-pom
ee7c934 Merge pull request #328 from jekh/remove-commons-dependencies
0d16280 Merge pull request #330 from jekh/fix-npe-from-invalid-request
3382c6e Replaced deprecated ossrh parent pom with updated nexus-staging-maven-plugin config. Updated plugin versions.
f1a86d4 Returning a Bad Gateway to clients when receiving an indecipherable response from upstream servers
e8af6a5 Added test for invalid server responses
7f5a850 Update tracking of current HTTP request in ProxyToServerConnection to avoid NPEs
2f13621 Removed redundant isHead method
034f80b Made commons-cli an optional dependency, since it is only used with the standalone Launcher
f65a0a7 Replaced commons-io and commons-code dependencies with guava and jdk equivalents
8ce850c Merge pull request #326 from jekh/update-dependencies-and-cleanup
da03f5d Merge pull request #327 from jekh/javadoc-error-fixes
a3d9123 Replaced self-closing <p/> tags with <p> to fix javadoc errors
c2ddbc1 Made remaining immutable variables in DefaultHttpProxyServer final
7acb652 Updated netty dependencies
96f09e4 Merge pull request #299 from jekh/remove-java-6
91bb503 Bumped selenium version to 2.53.1





브랜치 보이도록 decoreate 옵션을 사용한다

$ git log --oneline --decorate
70edbe1 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #388 from shs96c/guava-23
1792fac Bump guava to version 23
ac8a466 Merge pull request #355 from jekh/add-mitm-links-to-readme
9630e71 Added MITM links to readme
47bee7b [maven-release-plugin] prepare for next development iteration
f1ce0b6 (tag: littleproxy-1.1.2) [maven-release-plugin] prepare release littleproxy-1.1.2
27de860 Merge pull request #352 from jekh/dependency-updates
070e6c1 Merge pull request #351 from jekh/fix-memory-leak-on-initial-request
d1dffa8 Merge pull request #350 from luleyl/Keep-Alive_fixes
31c19ff Updated guava, dnsjava, slf4j, commons-lang, and test dependencies
08a36bc Fixing memory leak on initial request when HttpObjectAggregator is enabled
f816f3e Fix the repeated TimeOut response.
55fd04d Demonstrate that the TimeOut response is repeated.
43ee962 Merge pull request #349 from jekh/update-netty
a01674b Removed Transfer-Encoding portion of test due to change in netty behavior from netty PR#6270
f4fa693 Updated netty version to avoid false positive leak detection
2371cd7 Merge pull request #346 from jekh/allow-requests-to-origin-server
4ab9829 Added allowRequestsToOriginServer option to Bootstrap to allow handling origin-form requests
dfdb375 Merge pull request #343 from danielkyu/bug-format-accept-encoding-remove-sdch
6e0d253 Support for removing sdch encoding regardless of whether it is stored as a single/multi value
b92ed54 Merge pull request #334 from jekh/fix-invalid-client-request
faba98f Fixed test failure issue
7062538 Fixed bug where the 'Accept-Encoding' header could be improperly formatted after removing the 'sdch' encoding
b0792ae Responding with 400 and closing connection when client sends an invalid request
27dc4f4 Merge pull request #333 from jekh/update-docs
86e75d7 Update readme for 1.1.1 release
904aea3 [maven-release-plugin] prepare for next development iteration
098e16a (tag: littleproxy-1.1.1) [maven-release-plugin] prepare release littleproxy-1.1.1
7bf4483 Merge pull request #331 from jekh/remove-ossrh-parent-pom





그래프로 보고 싶다면 graph 옵션을 사용한다.

$ git log --oneline --decorate  --graph
*   70edbe1 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #388 from shs96c/guava-23
|\
| * 1792fac Bump guava to version 23
|/
*   ac8a466 Merge pull request #355 from jekh/add-mitm-links-to-readme
|\
| * 9630e71 Added MITM links to readme
|/
* 47bee7b [maven-release-plugin] prepare for next development iteration
* f1ce0b6 (tag: littleproxy-1.1.2) [maven-release-plugin] prepare release littleproxy-1.1.2
*   27de860 Merge pull request #352 from jekh/dependency-updates
|\
| * 31c19ff Updated guava, dnsjava, slf4j, commons-lang, and test dependencies
* |   070e6c1 Merge pull request #351 from jekh/fix-memory-leak-on-initial-request
|\ \
| * | 08a36bc Fixing memory leak on initial request when HttpObjectAggregator is enabled
| |/
* |   d1dffa8 Merge pull request #350 from luleyl/Keep-Alive_fixes
|\ \
| |/
|/|
| * f816f3e Fix the repeated TimeOut response.
| * 55fd04d Demonstrate that the TimeOut response is repeated.
|/
*   43ee962 Merge pull request #349 from jekh/update-netty
|\
| * a01674b Removed Transfer-Encoding portion of test due to change in netty behavior from netty PR#6270
| * f4fa693 Updated netty version to avoid false positive leak detection
|/
*   2371cd7 Merge pull request #346 from jekh/allow-requests-to-origin-server
|\
| * 4ab9829 Added allowRequestsToOriginServer option to Bootstrap to allow handling origin-form requests
|/
*   dfdb375 Merge pull request #343 from danielkyu/bug-format-accept-encoding-remove-sdch
|\
| * 6e0d253 Support for removing sdch encoding regardless of whether it is stored as a single/multi value
| * faba98f Fixed test failure issue
| * 7062538 Fixed bug where the 'Accept-Encoding' header could be improperly formatted after removing the 'sdch' encoding
* |   b92ed54 Merge pull request #334 from jekh/fix-invalid-client-request
|\ \
| |/
|/|
| * b0792ae Responding with 400 and closing connection when client sends an invalid request
|/
*   27dc4f4 Merge pull request #333 from jekh/update-docs
|\
| * 86e75d7 Update readme for 1.1.1 release
|/
* 904aea3 [maven-release-plugin] prepare for next development iteration
* 098e16a (tag: littleproxy-1.1.1) [maven-release-plugin] prepare release littleproxy-1.1.1
*   7bf4483 Merge pull request #331 from jekh/remove-ossrh-parent-pom
|\
| * 3382c6e Replaced deprecated ossrh parent pom with updated nexus-staging-maven-plugin config. Updated plugin versions.
* |   ee7c934 Merge pull request #328 from jekh/remove-commons-dependencies
|\ \
| * | 034f80b Made commons-cli an optional dependency, since it is only used with the standalone Launcher
| * | f65a0a7 Replaced commons-io and commons-code dependencies with guava and jdk equivalents




특정 기간부터 보고 싶다면. since와 until를 사용한다. (before, after도 사용할 수 있다)

$ git log --oneline --decorate --graph --since=10.weeks



$ git log --oneline --decorate --graph --until=1.days --since=5.years




특정 파일보고 싶다면. --를 사용한다.


$ git log -- COPYRIGHT.txt

commit 1627266fc58b4a1c2c3ba1d027389e55f9906a30

Author: afisk <a@littleshoot.org>

Date:   Sat Oct 24 22:45:04 2009 +0000


    Initial implementation of LittleShoot proxy based on Netty core





특정 커미터의 로그를 보고 싶다면 committer를 사용한다.


$ git log --oneline --decorate --graph --committer adamfisk

* 58765c5 Merge pull request #279 from jekh/upgrade-dependencies

* 075ec1d Merge pull request #278 from jekh/update-surefire-settings

* c3a4cec Merge pull request #211 from jekh/fix-ipv6-parsing

* 0d0c35b Merge pull request #191 from jekh/travis-ci-update

* f5c8ea7 Merge pull request #183 from jekh/add-abort-shutdown

* 7409b0b Merge pull request #187 from compcruz/master

* 2bf48bc Merge pull request #170 from jekh/request-sent-callback-after-content-sent

* bf3fd76 Merge pull request #172 from schoeffm/master

* 4c60fa8 Merge pull request #179 from jekh/remove-shutdown-hook-on-stop

* e3acc48 Merge pull request #176 from jekh/update-maven-plugin-versions

* 91db6fb Merge pull request #163 from jekh/allow-port-zer





stat를 사용하면 커밋에 대한 diff 정보를 간략히 볼 수 있다. 


 git log --stat

commit 70edbe1c502d79449fb5ceb9d00cca6a0759d56f

Merge: ac8a466 1792fac

Author: adamfisk <afisk@bravenewsoftware.org>

Date:   Mon Sep 25 06:43:29 2017 -0700


    Merge pull request #388 from shs96c/guava-23


    Bump guava to version 23


commit 1792facf4799347b9ae841bd577917f4b0296fd7

Author: Simon Stewart <simon.m.stewart@gmail.com>

Date:   Thu Aug 17 22:21:02 2017 +0100


    Bump guava to version 23


 pom.xml                                                               | 2 +-

 src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java | 4 ++--

 2 files changed, 3 insertions(+), 3 deletions(-)


commit ac8a466f6ca9db64efecbc72972502cfe6ec19d5

Merge: 47bee7b 9630e71

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 14:34:20 2017 -0800


    Merge pull request #355 from jekh/add-mitm-links-to-readme


    1.1.2 doc update & MITM links


commit 9630e71af4e5708ce87deb3d8b63a6a7b4a9019c

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 11:31:09 2017 -0800


    Added MITM links to readme


 README.md | 8 +++++++-

 1 file changed, 7 insertions(+), 1 deletion(-)


commit 47bee7b5e44b9ec514cd55be919aa3512abb74dc

Author: Jason Hoetger <jekh@outlook.com>

Date:   Sun Mar 5 11:07:19 2017 -0800


    [maven-release-plugin] prepare for next development iteration


 pom.xml | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)


commit f1ce0b6428bc86f1137a82ea6f9dae93a393f3c9




 

최신 로그 해시만 보려면 다음과 같이 reflog를 사용한다.


$ git reflog

70edbe1 HEAD@{0}: clone: from https://github.com/adamfisk/LittleProxy.git

$ git log

commit 70edbe1c502d79449fb5ceb9d00cca6a0759d56f

Merge: ac8a466 1792fac

Author: adamfisk <afisk@bravenewsoftware.org>

Date:   Mon Sep 25 06:43:29 2017 -0700


    Merge pull request #388 from shs96c/guava-23


    Bump guava to version 23



Posted by '김용환'
,

내가 예전에는 설치 파일/설정을 형상관리했는데, 요즘은 대충 ftp나 http(webdav)를 사용한다.

디스크가 날아가 고생하지 않도록 형상관리 툴을 사용하는 것을 선호하는 이는 git annex를 쓰면 좋을 것 같다.


최근에 gitlab에서 git-annex 라는 haskell로 개발한 툴을 사용한다고 발표했었는데..

https://about.gitlab.com/2015/02/17/gitlab-annex-solves-the-problem-of-versioning-large-binaries-with-git/


살펴보니 github에도 공개되어 있다. 

https://github.com/joeyh/git-annex

https://git-annex.branchable.com/



예제

https://julien.danjou.info/blog/2011/handling-my-music-collection-with-git-annex

'svn' 카테고리의 다른 글

git log 예제  (0) 2018.03.29
PC에 svn 서버 설치 도움되는 Site  (0) 2010.09.06
Setting property in svn repository  (0) 2009.04.17
php 로깅 관련  (0) 2008.01.18
cvs에서 cvs checkout: failed to create lock directory 에러 문제  (0) 2007.12.06
Posted by '김용환'
,

'svn' 카테고리의 다른 글

git log 예제  (0) 2018.03.29
[대용량 파일 다운받기] git annex in gitlab  (0) 2015.02.24
Setting property in svn repository  (0) 2009.04.17
php 로깅 관련  (0) 2008.01.18
cvs에서 cvs checkout: failed to create lock directory 에러 문제  (0) 2007.12.06
Posted by '김용환'
,
Setting property is possible in svn server like below.

${HOME}/.subversion/config

[auto-props]

*.c = svn:eol-style=native

*.rng = svn:eol-style=native
..

Besides, in source, there is a way to set property (using svn client).

<In Eclipse's subversive or subclipse>

Right-click on a certain sh file, see menu below.
Team>>Show Properties>>Add Property 

namevalue
svn:eol-style native
svn:executable *


Posted by '김용환'
,

php 로깅 관련

svn 2008. 1. 18. 10:59

 

 

marionweb.com에서 퍼옴

 

 

Intentionally throw PHP errors
Written by Marion Consulting   

Error messages are not something that most developers enjoy seeing, but they can be very useful especially when debugging or testing an applications code.  Sometimes we would like throw an error to see how the application behaves and below is an example of how to do just this.

trigger_error

Generates a user-level error/warning/notice message (PHP 4 >= 4.0.1, PHP 5)

bool trigger_error ( string error_msg [, int error_type] )
 

 

error_msg

The designated error message for this error. It's limited to 1024 characters in length. Any additional characters beyond 1024 will be truncated.

error_type

The designated error type for this error. It only works with the E_USER family of constants, and will default to E_USER_NOTICE.

Example usage: trigger_error ('I just threw an error", E_USER_ERROR); 

 

How to use log4php
Written by Marion Consulting   

This is a very basic tutorial on how to implement log4php into your php projects.

Log4php is a port of log4j, which is a very popular logging utility in java.  It works very nice in PHP and makes it very simple to log information in many different formats.  The following should allow you to begin using this new functionality in your applications.  Download the example code at a zip file that is provided in plain text below

Get log4php source from http://www.vxr.it/log4php/download.html

Untar/zip the files into a directory on your webserver machine.  There are many directories inside the archive that you do not need unless you want to look over the examples. 

      //define the following in your application

      define('LOG4PHP_DIR', 'log4php-0.9'); // the name of the log4php directory
        The log4php-<version>/src/log4php directory is the directory the above variable should point to.
     

      define('LOG4PHP_CONFIGURATION','log_configuration.xml');
 
      require_once(LOG4PHP_DIR.'/LoggerManager.php');    

      // You can create new logger managers for each script/function you call so you can determine where the logging is        occuring.  I suggest naming it the same as the script that it is in.
      $logger = & LoggerManager::getLogger('your_log_mgr_name');

      $logger->debug('place a debugging log statement here');
      $logger->info('place a info log statement here');
      $logger->warn('place a warning log statement here');
      $logger->error('place a error log statement here');
      $logger->fatal('place a fatal log statement here');

      LoggerManager::shutdown();

 

 

 

Explanation and Examples of log_configuration.xml

The xml file can be named whatever you wish, you just need to reference the appropriate name in the definition of LOG4PHP_CONFIGURATION above.  The xml below writes a log file to the filesystem for all logged messages (debug to fatal), and it sends an email to the specified email address on any fatal logged error.  The xml can be configured for a number of different formats, but the log file and email are my preferred logging methods.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    /**
    *  Script: log_configuration.xml
    *  Author: Author <tony [at] marionweb [dot] com>
    *  
    *  Purpose: Setup logging configuration
    *  Creation Date: 1/29/2006
    *  Details:  Currently setup to write to log file for all messages debug -> fatal.  All fatal messages are emailed to site admin.
    */
-->
<log4php:configuration xmlns:log4php="http://www.vxr.it/log4php/" threshold="all" debug="false">
    <appender name="write_to_log" class="LoggerAppenderDailyFile">
        <param name="datePattern" value="Ymd" />
        <param name="file" value="/path_to_logfile/logs/web_application_%s.log" />
        <layout class="LoggerLayoutTTCC">
            <param name="threadPrinting" value="true" />
            <param name="categoryPrefixing" value="true" />
            <param name="contextPrinting" value="true" />
            <param name="microSecondsPrinting" value="true" />
        </layout>
    </appender>
    <appender name="email_log" class="LoggerAppenderMailEvent">
        <param name="from" value=" admin@email.com" />
        <param name="to" value=" admin@email.com" />
        <param name="subject" value="Log4php test" />
        <layout class="LoggerLayoutTTCC" />
    </appender>
    <root>
        <level value="debug" />       
        <appender_ref ref="write_to_log" />
    </root>
    <root>
        <level value="fatal" />       
        <appender_ref ref="email_log" />
    </root>
</log4php:configuration>

Posted by '김용환'
,

 

cvs 리파지토리에서 새롭게 branch를 따려고 하니. 다음의 문제가 발생했다.

 

 : cvs checkout: failed to create lock directory for
`/usr/local/cvsrepo/project'
(/usr/local/cvsrepo/project/#cvs.lock): Permission denied
: cvs checkout: failed to obtain dir lock in repository
`/usr/local/cvsrepo/project'
: cvs [checkout aborted]: read lock failed - giving up

 

 

문제는 권한 문제.

cvs서버에 들어가서 권한에 대해서 잘 처리한다.

 

chown -R 그룹 /usr/local/cvsrepo/project

또는

chmod -R ug+ws /usr/local/cvsrepo/project

 

이렇게 해결하면 된다.

 

* 참조내용

http://www.mooreds.com/wordpress/archives/000234

'svn' 카테고리의 다른 글

Setting property in svn repository  (0) 2009.04.17
php 로깅 관련  (0) 2008.01.18
[펌] svn 사용법  (0) 2006.01.17
svn 명령시 깨지는 글자나 나타날 때.  (0) 2005.11.01
http://www.abbeyworkshop.com/howto/misc/svn01/  (0) 2005.06.10
Posted by '김용환'
,

[펌] svn 사용법

svn 2006. 1. 17. 23:38

출처 : 회사 동료분의 강의 text

계정은 ###으로 수정하였고, svn의 server address는 svn://address로 수정 표기하였다.

 


1. 디렉토리 확인하기
1.1
###@ubuntu:~ $ svn list svn://address/test
branches/
tags/
trunk/

3개의 디렉토리가 있는것을 확인 할 수 있다.

1.2
###@ubuntu:~ $ svn list svn://address/juliet
###@ubuntu:~ $
아직 juliet용으로는 디렉토리를 만든것이 없다는 것을 확인할 수 있다.

 

 

2. 디렉토리 만들기
2.1
###@ubuntu:~ $ svn mkdir svn://address/test/Documents


--This line, and those below, will be ignored--

A    svn://address/test/Documents
이런 화면을 보게된다.

새로 만든 디렉토리에 대한 설명을 적은후에 저장하고 나가면
"svn-commit.tmp" 4L, 123C written

Committed revision 16.
이렇게 나온다. 성공적으로 만들었다는 의미다.

2.2
확인해 보자 만들어졌다.
###@ubuntu:~ $ svn list svn://address/test/
Documents/
branches/
tags/
trunk/

 

3. 프로젝트 시작(만들어진 소스 리스트 올리기)
3.1
###@ubuntu:~ $ mkdir sampleprj

3.2
###@ubuntu:~ $ cd sampleprj/

3.3
###@ubuntu:~/sampleprj $ vi test.c
#include <stdio.h>

int main()
{
        printf("Hello SVN\n");
        return 0;
}

3.4
###@ubuntu:~/sampleprj $ vi Makefile
TARGET=test

all: $(TARGET)

$(TARGET): test.o
        gcc -o $(TARGET) test.o

test.o:
        gcc -c test.c

3.5
###@ubuntu:~/sampleprj $ make
gcc -c test.c
gcc -o test test.o

3.6
이제 프로젝트를 올려본다.
###@ubuntu:~/sampleprj $ cd ..
###@ubuntu:~ $ svn import sampleprj svn://address/test/trunk
테스트용으로 Sample Project를 만들어 올렸음

--This line, and those below, will be ignored--

A    sampleprj


Adding  (bin)  sampleprj/test
Adding         sampleprj/test.c
Adding         sampleprj/Makefile

Committed revision 17.

3.7
확인해본다
###@ubuntu:~ $ svn list svn://address/test
Documents/
branches/
tags/
trunk/
###@ubuntu:~ $ svn list svn://address/test/trunk
Makefile
test
test.c

3.8
다 올렸으니 지운다
###@ubuntu:~ $ rm -rf sampleprj/

 

4
sample이라는 디렉토리에 test/trunk의 프로젝트를 받아온다
###@ubuntu:~ $ svn co svn://address/test/trunk sample
A  sample/test
A  sample/test.c
A  sample/Makefile
Checked out revision 17.

5
###@ubuntu:~ $ cd sample/
###@ubuntu:~/sample $ ls
Makefile  test  test.c
###@ubuntu:~/sample $ svn update
At revision 17.

update가 있으면 받아온다. 없으니까 그냥 아직 revision 17이라고 적혀있다.

6
test.c를 수정한다.
#include <stdio.h>

int main()
{
        printf("Hello SVN\n");
        printf("Merong!!\n");
        return 0;
}

7.
고친내용과 서버의 내용을 비교해본다.
###@ubuntu:~/sample $ svn diff
Index: test.c
===================================================================
--- test.c      (revision 17)
+++ test.c      (working copy)
@@ -3,5 +3,6 @@
 int main()
 {
        printf("Hello SVN\n");
+       printf("Merong!!\n");
        return 0;
 }

8.
고친내용을 서버에 올린다
###@ubuntu:~/sample $ svn commit
test.c 파일에 printf 문장을 한줄 추가했음
--This line, and those below, will be ignored--

M    test.c

test.c라는 파일 하나 바꿨다고 아랫쪽에 적혀있다..

8.1
저장하고 나오면
"svn-commit.tmp" 4L, 103C written
Sending        test.c
Transmitting file data .
Committed revision 18.
이렇게 나온다. test.c 수정된 내용을 서버로 올렸다. 이제 revision은 18이다.

9
test.c 파일의 히스토리를 살펴본다
###@ubuntu:~/sample $ svn log test.c
------------------------------------------------------------------------
r18 | ### | 2005-03-24 12:10:19 +0900 (Thu, 24 Mar 2005) | 2 lines

test.c 파일에 printf 문장을 한줄 추가했음

------------------------------------------------------------------------
r17 | ### | 2005-03-24 12:02:25 +0900 (Thu, 24 Mar 2005) | 2 lines

테스트용으로 Sample Project를 만들어 올렸음

------------------------------------------------------------------------


10.
test2.c를 추가해본다
###@ubuntu:~/sample $ vi test2.c
int test()
{
        printf("test ftn\n");
}

###@ubuntu:~/sample $ svn add test2.c
A         test2.c

###@ubuntu:~/sample $ svn list
Makefile
test
test.c
아직 test2.c는 안올라갔다. (commit을 해야 올라간다)

###@ubuntu:~/sample $ svn commit
test2.c라는 파일 추가
--This line, and those below, will be ignored--

A    test2.c

"svn-commit.tmp" 4L, 84C written
Adding         test2.c
Transmitting file data .
Committed revision 19.
###@ubuntu:~/sample $ svn list
Makefile
test
test.c
test2.c

이제 추가되었다.


11
test라는 바이너리가 올라가있는게 맘에 안든다. 지워야겠다.
###@ubuntu:~/sample $ svn del test
D         test
###@ubuntu:~/sample $ svn list
Makefile
test
test.c
test2.c


아직 남아있다 commit한다.
###@ubuntu:~/sample $ svn commit
실행바이너리라 지움
--This line, and those below, will be ignored--

D    test
"svn-commit.tmp" 4L, 79C written
Deleting       test

Committed revision 20.
###@ubuntu:~/sample $ svn list
Makefile
test.c
test2.c

지워졌다.

Posted by '김용환'
,

svn 명령시 한글같은 것이 깨져 보이는 현상이 보일 때가 있다.

그 때는 .bash_profile을 다음과 같이 수정한다.

 

export LANG="C"

 

로케일을 수정하면, 꺠진 글자대신 영문이 보일 것이다.

Posted by '김용환'
,

 

Subversion Cheat Sheet

This Subversion cheat sheet was created during the initial setup of Subversion on Apache 2.0 on Windows and Mac OS X. A detailed tutorial covering most of the features of Subversion can be found in the online Subversion book. However, to make Subversion more useful for me, I created this Readers' Digest version.

Create a Repository

To store projects in Subversion, first you must create a repository. This must be done to a local drive on a local machine. Creating a repository on a network drive is not supported. To create a repository type:

UNIX

svnadmin create /path/to/repository

Windows

svnadmin create d:/path_to_repository

By default this sets up a Berkeley database to store the repository. Individual projects should be created as subdirectories of the repository directory (see the next section). Notice that the Windows version includes a drive letter, but also uses forward slashes instead of back slashes. The forward slashes are required even on Windows.

Add a New Project - svn import

To add a project, the Subversion documentation suggests that you create a directory structure like the following:

Picture of the Directory Structure

A root project directory contains three subdirectories, branches, tags, and trunk. Your files and directories are stored under the trunk directory.

Create the directories as described. Assuming the project directory is a subdirectory of the current directory, you would enter the following command

UNIX

svn import project file:///repository_name/project -m "First Import"

Windows

svn import project file:///d:/repository_name/project -m "First Import"

Network

svn import project http://host_name/svn_dir/repository_name/project -m "First Import"

Notice the Network example includes an svn_dir. This assumes you are using Apache 2.0 and the Subversion modules. When setting up Subversion on Apache, a virtual directory is created on the server that points to your repository directory. More information on Apache 2 setup is described later in this document.

This creates the initial project which you can work from. To get the files under version control, you must checkout a project to begin working on it.

Checking Out a Project - svn checkout

To start using the version control features check out a project into your local working directory. This is done with the following command:

UNIX

svn checkout file:///repository_name/project/trunk project

Windows

svn checkout file:///d:/repository_name/project/trunk project

Network

svn checkout http://host_name/svn_dir/repository_name/project/trunk project

In these examples, project is the name of the directory where you want to store the checked out project on your local file system.

Getting a List of Projects - svn list

To get a list of the current projects stored in a repository, you can use the following command.

UNIX

svn list --verbose file:///repository_name/project

Network

svn list --verbose http://host_name/svn_dir/repository_name/project

This will show you a list of each project directory in that repository.

Reviewing Changes - svn status

To see what files you have changed or added to your checked out work, use the update command:

UNIX

svn status

This command will give you a listing of new files, files that have been changed, and files that have been deleted. New files or deleted files must be added or removed using the add and delete commands (see more below.)

Adding New Files and Directories - svn add

When you add a new file or directory to a project that has been checked out, you must tell Subversion to include that file or directory in its version control.

UNIX

svn add file_or_dir_name

Adding a directory will add the directory and all the files and directories in it. However, this does not add the file or directory to the repository, you must still issue a commit to update the repository.

Deleting Files and Directories - svn delete

If you can add, you can also delete. If you wish to remove a file your directory from be versioned, you use the delete command:

UNIX

svn delete file_or_dir_name

Like add, you must perform a commit before the file is actually deleted from the repository.

However, the delete command does have another option not found in add. With the delete command you can remove files or directories from the repository. For example, the following command would remove a project and all the files under it.

Network

svn delete -m "Deleting project dir" http://localhost/svn_dir/repository/project_dir

This version of the command comes in particulary useful if someone has accidently imported files into the wrong place (I wouldn't know about that myself of course.)

Committing Changes - svn commit

Once you have added, deleted, or changed files or directories, you can then commit those changes to the repository. This command is pretty straightforward:

Network

svn commit -m "Saving recent changes" http://localhost/svn_dir/repository/project_dir

Updating Your Local Files - svn update

If you have a set of files checked out and would like to update them to the most recent version of files in the repository, use the update command.

Network

svn update

If there are newer files in the repository, they will overwrite any files you have locally. Before using this command, you may want to use the svn diff command to find out what the differences are between your local files and the repository.

Tagging Projects or Creating Project Specific Versions

Subversion does not track the version numbers for individual projects automatically. Instead, it tracks each update to the repository and tracks the versions of these updates. To create interim project releases, you must create "Tags" which identify a specify version of a project. This is done by making a virtual copy of a project in the tags directory. For example:

svn copy http://host_name/repos/project/trunk http://host_name/repos/project/tags/0.1.0 -m "Tagging the 0.1.0 release of the project"

This creates a sort of bookmark or snapshot which records the current state of the project. Then, you can checkout the project in this state at any time by simply referring to that release number.

To get a list of the releases for a project.

svn list http://192.168.0.4/svn/repos/prj1/tags
0.1.0/

Then to check out a release you would type:

svn list http://192.168.0.4/svn/repos/prj1/tags/0.1.0

A  0.1.0\dir1
A  0.1.0\dir1\file3
A  0.1.0\dir1\file4
A  0.1.0\file1
A  0.1.0\file2
A  0.1.0\textfile.txt
A  0.1.0\file3
		Checked out revision 13.
		

Since the project has been saved in the tags directory. Release 0.1.0 can be retrieved at any time in the future.

Basic Apache Setup

You must use Apache 2.0 to install Subversion. Just compile and copy or copy the Subversion Apache module into the Apache modules directory. The following two files must be uncommented or added to the httpd.conf file:

		LoadModule dav_module         modules/mod_dav.so
		LoadModule dav_svn_module     modules/mod_dav_svn.so
		

Next, you must setup a location directive in the httpd.conf file to associate a directory with Subversion repositories. This example uses the SVNParentPath setting to point to a parent directory which contains repository subdirectories. This is convenient as it allows you to add as many repositories as you need without having to restart Apache or modify the httpd.conf file.

		<Location /svn>
			DAV svn
			
			# All repos subdirs of d:/svn
			SVNParentPath D:/svn
		</Location>
		

Note:When using Fink to install Subversion on Mac OS X, the Subversion Apache module is stored in the Fink package listing with the prefix: libapache2. The package full name is libapache2-mod-svn. If you are using Fink, it will automatically install the modules into the correct directory.

General Notes

Below are a list of notes from initial setup and testing.

  • Subversion versions the repository, not individual projects. For example, I have two projects, project 1 and project 2, and check out each project when the current repository version is 3. I make changes to each project and commit those changes back to the repository. For each change, the revision number is incremented in the repository and its current version is now 5. The current revision of each project will also be 5 as they have no separate revision number.
  • To setup the Subversion module on Apache for Windows, I had to give the Apache Service access to the local file system. This is done on Windows by setting up a login account for the service. Setup an account in the Users application in Control Panel, make sure to set the password. Once this is done, go to the Services tool in Control Panel. Change the login for the Service to the account you created. XP will automatically give the Login as a Service privilege to the account (the OS must do this as the tools are not available XP Home, only in XP Pro). Once you do this and start and stop the Apache Service, you should be able to read and write to the repository directories. Note: Setting up a log in account for a Service can create a security hole. Consider your security requirements before doing this.
  • Individual files and directories that did not exist during the initial import, must be added individually using the svn add command.

의외로 많이. svn 명령때문에 시간을 먹기도 한다. 그래서 퍼옴.

출처 : http://www.abbeyworkshop.com/howto/misc/svn01/

'svn' 카테고리의 다른 글

[펌] svn 사용법  (0) 2006.01.17
svn 명령시 깨지는 글자나 나타날 때.  (0) 2005.11.01
svn freebook  (0) 2005.05.30
tip) 파일 하나만 Rep에서 가져오기  (0) 2005.05.30
TortoiseSVN  (0) 2005.05.30
Posted by '김용환'
,

svn freebook

svn 2005. 5. 30. 09:55

http://svnbook.red-bean.com/en/1.0/index.html

프리북이다.

개인적으로 너무 산만하게 구성한 거 같아서.. index 로 찾는거 외엔 안함.. 쩝..

'svn' 카테고리의 다른 글

svn 명령시 깨지는 글자나 나타날 때.  (0) 2005.11.01
http://www.abbeyworkshop.com/howto/misc/svn01/  (0) 2005.06.10
tip) 파일 하나만 Rep에서 가져오기  (0) 2005.05.30
TortoiseSVN  (0) 2005.05.30
svn getting started with svn  (0) 2005.05.30
Posted by '김용환'
,