프로가 되자.

Xcode 자동 완성 부분 disable 하기

오랜만의 포스팅 입니다.

Xcode에서 자동 완성이 귀찮을 경우 또는 수정이 필요한 경우 해당 keyword를 disable 할 수 있습니다.


우선 Xcode 설치 디렉토리안의

Applications/Xcode.app/Contents/PlugIns/TextMacros.xctxtmacro/Contents/Resources

디렉토리로 이동하신 뒤

(예: /Developer/Applications/Xcode.app/Contents/PlugIns/TextMacros.xctxtmacro/Contents/Resources)

C.xctxtmacro 파일을 편집 해 주시면 됩니다.


위 파일을 열면..

{
  Identifier = c.block.if;
  BasedOn = c.block;
  Name = "If Block";
  IsMenuItem = YES;
  OnlyAtBOL = YES;
  Command = "if";
  Expressions = "<#condition#>";
  CompletionPrefix = if;
  CycleList = (
      c.block.if,
      c.block.ifelse,
  );
},

와 같은 code block이 나오는데 이 부분을 적당히 검색 하셔서 삭제 또는 주석처리(/* ~ */) 하시면 됩니다.

수정한 뒤 Xcode를 재시작 하면 제대로 적용된 것을 보실 수 있습니다.

이 부분을 이용하여 자기가 원하는 자동완성을 등록해도 됩니다.
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2010/08/09 17:19 2010/08/09 17:19

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , , 태그가 달려있으며,
2010/08/09 17:19에 작성되었습니다.

Android SDK 문제 해결

Android SDK를 다운로드한 뒤 tools/android update sdk 를 실행하면

Failed to fetch URL https://dl-ssl.google.com/andr oid/repository/repository.xml

와 같이 오류가 발생할 때가 있습니다.
이럴땐

~/.android/androidtool.cfg 파일을 열어

sdkman.force.http = true

라고 입력 한 뒤 재시도 하면 됩니다. (파일이 없으면 생성)
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/12/04 10:19 2009/12/04 10:19

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, 태그가 달려있으며,
2009/12/04 10:19에 작성되었습니다.

Ubuntu 에서 man page 보기

기본으로 설정 되어 있는 Ubuntu 환경에서는 man page가 보이지 않는다.

이럴 경우 다음과 같은 package 추가를 통해 man page를 사용할 수 있다.

sudo apt-get install manpages-dev
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/12/01 17:46 2009/12/01 17:46

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , 태그가 달려있으며,
2009/12/01 17:46에 작성되었습니다.

Android 다운로드 시 “remote end hung up unexpectedly" 오류가 발생할 때

Android platform을 repo를 이용하여 git에서 다운로드 할 때 자꾸 remote end hung up unexpectedly 라는 오류가 나면서 접속이 끊기는 경우가 있습니다.

이럴 땐 다음과 같은 방법으로 피해(?)를 최소화 할 수 있습니다:

1. repo init 하여 초기화 해 놓은 디렉토리로 이동합니다.
2. vi .repo/repo/subcmds/sync.py 를 이용하여 sync.py 파일을 편집합니다
3. _Fetch를 검색하여 다음과 같이 수정합니다.

def _Fetch(self, projects):
fetched = set()
pm = Progress('Fetching projects', len(projects))
for project in projects:
pm.update()
while True:
if project.Sync_NetworkHalf():
fetched.add(project.gitdir)
break
else:
print >>sys.stderr, 'error: Cannot fetch %s' % project.name
pm.end()
return fetched


기존의 소스와 달라진 점이 있다면

"while True:"와 "break"를 추가한 것과 "sys.exit(1)" 을 삭제한 것이 다릅니다. 즉 그냥 소스 코드 다운로드 될 때 까지 무한 루프 돌겠다 이거죠.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/11/20 10:21 2009/11/20 10:21

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , , 태그가 달려있으며,
2009/11/20 10:21에 작성되었습니다.

putty에서 인증 과정 ppk로 대체하기

putty에서 비밀번호 입력 과정을 ppk로 처리하는 방법 입니다.

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

원래 ssh는 private_key와 public_key인증 및 ssh_agent를

이용하여 서버에 패스워드 인증없이 접속이 가능하다.

Putty도 SSH1에서는 이기능을 사용할 수 있는 것으로 알려졌다.
하지만, 보안상의 이유로 SSH1 키 인증은 사용을 꺼려지고 있다.

Putty나름대로... SSH2에서도 PuttyGen을 이용하여 Private키를 생성하여
접속을 가능하게 하여고 했으나.. 아직까지는 개발이 진행되지는 않았다.

Putty 0.53b의 Puttygen은 openssh에서 생성된 SSH2 private_key를
Putty 고유의 키로 변환하는 기능을 제공하는데..
이방식을 이용하면. SSH2로 Putty도 인증없이 접속이 가능하다!!!

1. Private_key 생성하기.
Putty로 일단 접속하고자 하는 서버에 접속을 한다.
그리고 다음과 같이 키를 생성한다.

[admin@ns admin]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/admin/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/admin/.ssh/id_rsa.
Your public key has been saved in /home/admin/.ssh/id_rsa.pub.
The key fingerprint is:
ff:a5:10:ad:c8:7a:4f:40:42:69:df:c3:00:d3:a3:5b <a href="mailto:admin@ns.foobar.net">admin@ns.foobar.net</a>
[admin@ns admin]$

이 때 암호는 입력하지 않아도 된다. 나중에 따로 지정할 수 있기 때문이다.
자 생성된 Public Key를 authorized_keys로 옮기고..
서버가 키로 접속이 가능한지 테스트 해본다.
[admin@ns admin]$ mv .ssh/id_rsa.pub .ssh/authorized_keys
[admin@ns admin]$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 89:79:86:1b:cb:fc:a0:05:9c:65:88:b5:4c:1b:7f:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Last login: Sun Jan 11 00:43:26 2004 from 192.168.0.25
[admin@ns admin]$

자 다음과 같이 패스워드를 묻지 않고 접속이 가능하다면..
일단계 성공이다. 만약... 위의 방법으로 접속이 실패했다면...
sshd가 인증키로 인증을 허용하지 않기 때문이다.
이럴 경우.
sshd_config(보통은 /etc/ssh/sshd_config)에 다음 두줄이 포함되어 있는지 확인하자.
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

주석처리되어 있으면 주석을 풀어주고, 없으면 추가해 놓은 후...
서버를 재시작하고.. 다시 위의 방법으로 시도해본다.

이부분에 관련된 자세한 내용은 아래의 링크를 참조해보라.
인증키 사용하기

2. Key를 가져와 Putty의 PPK로 변환하기..
자 psftp나 다른 ssh2 sftp가 지원되는 클라이언트로 생성한 private_key를 가져온다. 여기서는 putty와 함께 포함된 psftp를 사용했다.

C:\Program Files\HangulPuTTY>psftp <a href="mailto:admin@ns.foobar.net">admin@ns.foobar.net</a>
사용자 이름 "admin"으로 시도합니다.
<a href="mailto:admin@ns.foobar.net">admin@ns.foobar.net</a> 의 비밀번호:
Remote working directory is /home/admin
psftp> get ./.ssh/id_rsa
remote:/home/admin/.ssh/id_rsa => local:id_rsa
psftp>exit
C:\Program Files\HangulPuTTY>

이젠 puttygen을 이용하여 putty의 고유 개인키 포멧인 ppk로 변환할 차례이다. puttygen을 실행하면... 오른쪽 하단부분에 load라는 버튼이 보일 것이다.
그걸 클릭한 후.. 받아온 id_rsa파일을 열자. 파일형식이 ppk로 지정되어 있음으로... 모든 파일보기로 고쳐야 읽을 수 있을 것이다.
그럼 Succe... convert save어쩌고 하는 메세지 박스를 볼 수 있는데..
내용은 성공적으로 openssh 개인키를 가져오는 데 성공했고..
이 키를 사용하려면... 다시 ppk로 저장해야 한다는 내용을 설명하는 것이다.

자.. 이제.. load 및에 있는 save private key를 눌러...
Putty Private key=ppk로 저장한다.
이때 패스워드를 넣지 않으면.. 경고가 뜨는데..
개인의 취향대로 한다. 넣어둘 경우... pagent를 이용하면..
나중에 역시 패스워드 없이 접속이 가능해진다.

3. putty 설정..
여기서는 iputty(한글 Putty)를 기준으로 한다. 영어와 한글의 차이일뿐
100% 동일하리라 믿는다.

일단 putty를 실행시킨후,
호스트 이름과 저장된 세션에 적절한 내용을 입력한다.(물론 프로토콜은 ssh로 해야한다.!!!)

왼쪽의 하단 부분에 "접속" 을 클릭한다음.. 계정명을 입력한다.
입력했으면 "접속" 및의 SSH->인증을 클릭하고...

인증키 파일에 전에 생성한 ppk파일 경로를 지정한다.
다시 세션을 클릭한후.. 저장을 눌러 세션을 저장한다.

자 대망의 Password 인증없이 접속할 차례다.
떨리는 마음으로 열기을 눌러 보자!!!
약간의 지연과 함께... 다음과 같은 메세지가 나오면 성공한 것이다!!!

사용자 이름 "admin"으로 시도합니다.
에이전트로 인증되었습니다: 공개 키 "imported-openssh-key"
Last login: Tue Jan 13 03:05:24 2004 from 192.168.0.25
[admin@ns admin]$

만약 ... ppk에 암호를 지정했던 사람들은 암호를 물어 볼것이다.
그럴 경우 원 암호가 아니라, ppk에 지정된 암호를 입력하면...된다.

4. pagent를 이용하기.
이 부분은 ppk에 암호를 지정한 사람들에게만 해당된다.
pagent를 실헹하면 오른쪽 트레이에 모자를 쓴 putty의 아이콘이 등록된다.

오른쪽 마우스클릭하면.. addkey라는 것이 보일 것이다.
이를 클릭하면 키를 지정할 수 있는 창이 열린다.
해당 키를 지정하면.. 키의 암호를 묻는데...
이때 PPK의 암호를 입력한다.
그 다음 putty로 해당 세션으로 접속을 시도하면...
더이상 암호를 묻지 않는다.

자 putty로 서버를 관리하던 많은 사람들이여...
이제 보다 편리하게 서버를 관리하자!!..

끝으로 한글 putty를 개발하고 계신 perky님께 감사의 말씀을 드리면서...

ps..
추가로.. 아까 생성한 id_rsa.pub = authorized_keys도
재활용이 가능하다. 일단 psftp등으로 로컬로 복사받은 다음...
매 서버마다 위의 과정으로 매번 키를 생성하지 말고..
원격 접속이 필요한 서버에 pscp를 이용하여 복사해 넣으면 된다.

C:\Program Files\HangulPuTTY>pscp authorized_keys admin@anotherhost:.ssh/authorized_keys

아니면.. 생성된 호스트에서..
[admin@ns admin]$scp ~/.ssh/authorized_keys admin@anotherhost:.ssh/authorized_keys

ps2
접속지연은 접속자의 호스트네임을 채크하는 것 때문에 그렇다.
접속자의 호스트네임 및 IP를 /etc/hosts 파일에 등록하면..
지연속도를 줄일 수 있다.


출처: http://kldp.org/node/28907

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/11/09 20:25 2009/11/09 20:25

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, 태그가 달려있으며,
2009/11/09 20:25에 작성되었습니다.

Reverse SSH Tunneling

[ A(1.1.1.1) <-> NAT ] <-> B(2.2.2.2)

위와 같은 구조로 되어 있는 네트워크 망 에서 NAT망 안에 있는 A에서 B로 SSH접속하는 것은 매우 간단합니다. 그냥 SSH로 접속하면 되기 때문이죠.
그런데 B에서 A로 접속한다면?
이러한 경우 Reverse SSH 접속으로 포트 포워딩을 해서 접속할 수 있습니다.

1. tunneling

ssh -R <터널링 할 포트>:localhost:<로컬 포트> <B에 있는 계정>@2.2.2.2 


<터널링 할 포트>: B에 열릴 포트 입니다. 예를 들어서 1234라고 한다면 B에 1234/TCP 포트가 LISTEN상태로 됩니다.
<로컬 포트>: B와 연결 될 A의 포트 입니다.
<B에 있는 계정>: B로 접속 가능한 SSH 계정 입니다.

예:
A-server$ ssh -R 1234:localhost:22 accessdenied@example.com
example.com 서버에 accessdenied계정으로 접속 하면서 localhost의 22번 포트를 example.com의 1234포트로 터널링

2. connect

1번 과정을 거치면  A에서 B로 일반적인 SSH와 같은 접속이 됩니다. 여기서 일반 SSH 접속과 다른 점이 한 가지 있다면 B에 1234포트가 열린다는 것이죠.
B에서 A로 접속할 땐 단순히 <터널링 할 포트>로 SSH 하시면 됩니다.

예:
B-server$ ssh localhost -p 1234
B에서 그냥 localhost의 1234번 포트로 SSH 접속하면 터널링 된 포트를 통해 A로 SSH 접속이 가능합니다.
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/10/16 11:24 2009/10/16 11:24

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , 태그가 달려있으며,
2009/10/16 11:24에 작성되었습니다.

Git vs SVN

SVN을 사용하다 Git로 오니 상당히 헤메게 되네요.
지나가다 좋은 자료가 있어 업로드 합니다.

GitHome | Documentation | Wiki | Download Site | Git's Gitweb

Git - SVN Crash Course

Welcome to the Git version control system! Here we will briefly introduce you to Git usage based on your current Subversion knowledge. You will need the latest Git installed; There is also a potentially useful tutorial in the Git documentation.

If you are just after tracking someone else's project, this get you started quickly:

git clone url
git pull
svn checkout url
svn update

How to Read Me

In those small tables, at the left we always list the Git commands for the task, while at the right the corresponding Subversion commands you would use for the job are listed. If you are in hurry, just skimming over them should give you a good idea about the Git usage basics.

Before running any command the first time, it's recommended that you at least quickly skim through its manual page. Many of the commands have very useful and interesting features (that we won't list here) and sometimes there are some extra notes you might want to know. There's a quick usage help available for the Git commands if you pass them the -h switch.

Things You Should Know

There are couple important concepts it is good to know when starting with Git. If you are in hurry though, you can skip this section and only get back to it when you get seriously confused; it should be possible to pick up with just using your intuition.

  • Repositories. With Subversion, for each project there is a single repository at some detached central place where all the history is and which you checkout and commit into. Git works differently, each copy of the project tree (we call that the working copy) carries its own repository around (in the .git subdirectory in the project tree root). So you can have local and remote branches. You can also have a so-called bare repository which is not attached to a working copy; that is useful especially when you want to publish your repository. We will get to that.
  • URL. In Subversion the URL identifies the location of the repository and the path inside the repository, so you organize the layout of the repository and its meaning. Normally you would have trunk/, branches/ and tags/ directories. In Git the URL is just the location of the repository, and it always contains branches and tags. One of the branches is the default (normally named master).
  • Revisions. Subversion identifies revisions with ids of decimal numbers growing monotonically which are typically small (although they can get quickly to hundreds of thousands for large projects). That is impractical in distributed systems like Git. Git identifies revisions with SHA1 ids, which are long 160-bit numbers written in hexadecimal. It may look scary at first, but in practice it is not a big hurdle - you can refer to the latest revision by HEAD, its parent as HEAD^ and its parent as HEAD^^ = HEAD~2 (you can go on adding carrets), cut'n'paste helps a lot and you can write only the few leading digits of a revision - as long as it is unique, Git will guess the rest. (You can do even more advanced stuff with revision specifiers, see the git-rev-parse manpage for details.)
  • Commits. Each commit has an author and a committer field, which record who and when created the change and who committed it (Git is designed to work well with patches coming by mail - in that case, the author and the committer will be different). Git will try to guess your realname and email, but especially with email it is likely to get it wrong. You can check it using git config -l and set them with:
    git config --global user.name "Your Name Comes Here"
    git config --global user.email you@yourdomain.example.com
    
  • Commands. The Git commands are in the form git command. You can interchangeably use the git-command form as well.
  • Colors. Git can produce colorful output with some commands; since some people hate colors way more than the rest likes them, by default the colors are turned off. If you would like to have colors in your output:
    git config --global color.diff auto
    git config --global color.status auto
    git config --global color.branch auto
    
  • Visualize. You may find it convenient to watch your repository using the gitk repository as you go.

Commiting

For the first introduction, let's make your project tracked by Git and see how we get around to do daily development in it. Let's cd to the directory with your project and initialize a brand new Git repository with it:

git init
git add .
git commit
svnadmin create repo
svn import file://repo

git init will initialize the repository, git add . will add all the files under the current directory and git commit will create the initial import, given that repositories are coupled with working copies.

Now your tree is officially tracked by Git. You can explore the .git subdirectory a bit if you want, or don't if you don't care. Do some random changes to your tree now - poke into few files or such. Let's check what we've done:

git diffsvn diff | less

That's it. This is one of the more powerful commands. To get a diff with an specific revision and path do:

git diff rev pathsvn diff -rrev path

Git embeds special information in the diffs about adds, removals and mode changes:

git applypatch -p0

That will apply the patch while telling Git about and performing those "meta-changes".

There is a more concise representation of changes available:

git statussvn status

This will show the concise changes summary as well as list any files that you haven't either ignored or told Git about. In addition, it will also show at the top which branch you are in.

While we are at the status command, over time plenty of the "Untracked files" will get in there, denoting files not tracked by Git. Wait a moment if you want to add them, run git clean if you want to get rid of all of them, or add them to the .gitignore file if you want to keep them around untracked (works the same as the svn:ignore property in SVN).

To restore a file from the last revision:

git checkout pathsvn revert path

You can restore everything or just specified files.

So, just like in SVN, you need to tell Git when you add, move or remove any files:

git add file 
git rm file 
git mv file
svn add file
svn rm file
svn mv file

You can also recursively add/remove whole directories and so on; Git's cool!

So, it's about time we commit our changes. Big surprise about the command:

git commit -asvn commit

to commit all the changes or, as with Subversion, you can limit the commit only to specified files and so on. A few words on the commit message: it is customary to have a short commit summary as the first line of the message, because various tools listing commits frequently show only the first line of the message. You can specify the commit message using the -m parameter as you are used, but you can pass several -m arguments and they will create separate paragraphs in the commit message:

If you don't pass any -m parameter or pass the -e parameter, your favorite $EDITOR will get run and you can compose your commit message there, just as with Subversion. In addition, the list of files to be committed is shown.

And as a bonus, if you pass it the -v parameter it will show the whole patch being committed in the editor so that you can do a quick last-time review.

By the way, if you screwed up committing, there's not much you can do with Subversion, except using some enigmatic svnadmin subcommands. Git does it better - you can amend your latest commit (re-edit the metadata as well as update the tree) using git commit --amend, or toss your latest commit away completely using git reset HEAD^, this will not change the working tree.

Browsing

Now that we have committed some stuff, you might want to review your history:

git log
git blame file
svn log | less
svn blame file

The log command works quite similar in SVN and Git; again, git log is quite powerful, please look through its options to see some of the stuff it can do.

The blame command is more powerful as it can detect the movement of lines, even with file copies and renames. But there is a big chance that you probably want to do something different! Usually, when using annotate you are looking for the origin of some piece of code, and the so-called pickaxe of Git is much more comfortable tool for that job (git log -Sstring shows the commits which add or remove any file data matching string).

You can see the contents of a file, the listing of a directory or a commit with:

git show rev:path/to/file 
git show rev:path/to/directory 
git show rev
svn cat url 
svn list url 
svn log -rrev url 
svn diff -crev url

Tagging and branching

Subversion marks certain checkpoints in history through copies, the copy is usually placed in a directory named tags. Git tags are much more powerful. The Git tag can have an arbitrary description attached (the first line is special as in the commit case), some people actually store the whole release announcements in the tag descriptions. The identity of the person who tagged is stored (again following the same rules as identity of the committer). You can tag other objects than commits (but that is conceptually rather low-level operation). And the tag can be cryptographically PGP signed to verify the identity (by Git's nature of working, that signature also confirms the validity of the associated revision, its history and tree). So, let's do it:

git tag -a namesvn copy http://example.com/svn/trunk http://example.com/svn/tags/name

To list tags and to show the tag message:

git tag -l
git show tag
svn list http://example.com/svn/tags/ 
svn log --limit 1 http://example.com/svn/tags/tag

Like Subversion, Git can do branches (surprise surprise!). In Subversion, you basically copy your project to a subdirectory. In Git, you tell it, well, to create a branch.

git branch branch 
git checkout branch
svn copy http://example.com/svn/trunk http://example.com/svn/branches/branch 
svn switch http://example.com/svn/branches/branch

The first command creates a branch, the second command switches your tree to a certain branch. You can pass an extra argument to git branch to base your new branch on a different revision than the latest one.

You can list your branches conveniently using the aforementioned git-branch command without arguments the listing of branches. The current one is denoted by an "*".

git branchsvn list http://example.com/svn/branches/

To move your tree to some older revision, use:

git checkout rev 
git checkout prevbranch
svn update -r rev
svn update

or you could create a temporary branch. In Git you can make commits on top of the older revision and use it as another branch.

Merging

Git supports merging between branches much better than Subversion - history of both branches is preserved over the merges and repeated merges of the same branches are supported out-of-the-box. Make sure you are on one of the to-be-merged branches and merge the other one now:

git merge branch(assuming the branch was created in revision 20 and you are inside a working copy of trunk) 
svn merge -r 20:HEAD http://example.com/svn/branches/branch

If changes were made on only one of the branches since the last merge, they are simply replayed on your other branch (so-called fast-forward merge). If changes were made on both branches, they are merged intelligently (so-called three-way merge): if any changes conflicted, git merge will report them and let you resolve them, updating the rest of the tree already to the result state; you can git commit when you resolve the conflicts. If no changes conflicted, a commit is made automatically with a convenient log message (or you can do git merge --no-commitbranch to review the merge result and then do the commit yourself).

Aside from merging, sometimes you want to just pick one commit from a different branch. To apply the changes in revision rev and commit them to the current branch use:

git cherry-pick revsvn merge -c rev url

Going Remote

So far, we have neglected that Git is a distributed version control system. It is time for us to set the record straight - let's grab some stuff from remote sites.

If you are working on someone else's project, you usually want to clone its repository instead of starting your own. We've already mentioned that at the top of this document:

git clone urlsvn checkout url

Now you have the default branch (normally master), but in addition you got all the remote branches and tags. In clone's default setup, the default local branch tracks the origin remote, which represents the default branch in the remote repository.

Remote branch, you ask? Well, so far we have worked only with local branches. Remote branches are a mirror image of branches in remote repositories and you don't ever switch to them directly or write to them. Let me repeat - you never mess with remote branches. If you want to switch to a remote branch, you need to create a corresponding local branch which will "track" the remote branch:

git checkout --track -b branch origin/branchsvn switch url

You can add more remote branches to a cloned repository, as well as just an initialized one, using git remote add remote url. The command git remote lists all the remotes repositories and git remote show remote shows the branches in a remote repository.

Now, how do you get any new changes from a remote repository? You fetch them: git fetch. At this point they are in your repository and you can examine them using git log origin (git log HEAD..origin to see just the changes you don't have in your branch), diff them, and obviously, merge them - just do git merge origin. Note that if you don't specify a branch to fetch, it will conveniently default to the tracking remote.

Since you frequently just fetch + merge the tracking remote branch, there is a command to automate that:

git pullsvn update

Sharing the Work

Your local repository can be used by others to pull changes, but normally you would have a private repository and a public repository. The public repository is where everybody pulls and you... do the opposite? Push your changes? Yes! We do git push remote which will push all the local branches with a corresponding remote branch - note that this works generally only over SSH (or HTTP but with special webserver setup). It is highly recommended to setup a SSH key and an SSH agent mechanism so that you don't have to type in a password all the time.

One important thing is that you should push only to remote branches that are not currently checked out on the other side (for the same reasons you never switch to a remote branch locally)! Otherwise the working copy at the remote branch will get out of date and confusion will ensue. The best way to avoid that is to push only to remote repositories with no working copy at all - so called bare repositories which are commonly used for public access or developers' meeting point - just for exchange of history where a checked out copy would be a waste of space anyway. You can create such a repository. See Setting up a public repository for details.

Git can work with the same workflow as Subversion, with a group of developers using a single repository for exchange of their work. The only change is that their changes aren't submitted automatically but they have to push (however, you can setup a post-commit hook that will push for you every time you commit; that loses the flexibility to fix up a screwed commit, though). The developers must have either an entry in htaccess (for HTTP DAV) or a UNIX account (for SSH). You can restrict their shell account only to Git pushing/fetching by using the git-shell login shell.

You can also exchange patches by mail. Git has very good support for patches incoming by mail. You can apply them by feeding mailboxes with patch mails to git am. If you want to sendpatches use git format-patch and possibly git send-email. To maintain a set of patches it is best to use the StGIT tool (see the StGIT Crash Course).

If you have any questions or problems which are not obvious from the documentation, please contact us at the Git mailing list at git@vger.kernel.org. We hope you enjoy using Git!


출처: http://git.or.cz/course/svn.html
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/10/13 14:36 2009/10/13 14:36

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , 태그가 달려있으며,
2009/10/13 14:36에 작성되었습니다.

Ubuntu 버전 확인

cat /etc/issue
lsb_release -a
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/10/12 15:18 2009/10/12 15:18

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , 태그가 달려있으며,
2009/10/12 15:18에 작성되었습니다.

iPhone 버전 판별하기

iPhone 개발을 하다 보면 컴파일 시 버전을 판단해야 되는 경우가 있습니다.

단순히 버전만을 체크할 경우

#define __IPHONE_2_0     20000  
#define __IPHONE_2_1 20100
#define __IPHONE_2_2 20200
#define __IPHONE_3_0 30000

와 같은 매크로를 사용하면 됩니다. (Availability.h에 선언되어 있습니다)
즉 다음과 같이..

#ifdef __IPHONE_3_0
// 3.0일 때 처리
#endif

하면 되죠.
그런데 "현재 버전"의 "이상", 즉 "2.2 이상에서만"이라는 조건은 여러개의 항목들을 전부 조합하여 사용할 수도 있지만, 다음과 같은 방법을 이용하여 판단할 수 있습니다

#if defined(__IPHONE_3_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_0)


__IPHONE_OS_VERSION_MIN_REQUIRED는 현재 버전에서 지원되는 최소 버전이며, __IPHONE_OS_VERSION_MAX_ALLOWED는 현재 버전에서 지원되는 최대 버전입니다.
따라서 __IPHONE_OS_VERSION_MAX_ALLOWED를 이용하면 "현재 버전에서 지원되는 최대 버전" 이하/이상 등의 조건을 사용할 수 있습니다.

이 때 주의할 점은, 2.0의 경우 __IPHONE_3_0이라는 매크로가 정의 되어 있지 않기 때문에 defined()를 이용하여 정의 되어 있는지 먼저 검사하여야 정확한 버전 비교가 됩니다.
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/09/30 11:23 2009/09/30 11:23

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, 태그가 달려있으며,
2009/09/30 11:23에 작성되었습니다.

Mac OS X의 키 설정을 윈도우 같이 하기

Windows만 사용하시다 Mac OS X로 넘어오시면.. 가장 처음 적응 안되는 것 중 하나가 단축키 입니다.
이러한 단축키를 Windows 같이 "비슷하게" 변경할 수 있는데요.. 다음과 같이 설정 해 주시면 됩니다.

* 일반 응용 프로그램에서 키보드 배치 변경하기
1. DefaultKeyBinding.dict 파일 편집 (없으면 생성)
$ vi ~/Library/KeyBindings/DefaultKeyBinding.dict


2. 다음과 같이 입력
{
/* home */
"\UF729" = "moveToBeginningOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";

/* end */
"\UF72B" = "moveToEndOfLine:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";

/* page up/down */
"\UF72C" = "pageUp:";
"\UF72D" = "pageDown:";
}


* 터미널(terminal) 응용 프로그램에서 키보드 배치 변경하기
1. 터미널 실행
2. 환경설정-설정-키보드로 이동
3. home, end, page up, page down을 다음과 같은 값으로 변경
home: \033[1~
end: \033[4~
page up: \033[5~
page down: \033[6~
shift page down: "버퍼에서 다음 페이지로 스크롤"
shift page up: "버퍼에서 이전 페이지로 스크롤"
- 참고
  - \033은 "esc"키를 누르면 나옵니다
  - 기존에 "작업" 부분이 "버퍼에서~"로 되어 있는 항목은 "문자열을 셀로 보내기:"로 변경한 뒤 키를 입력하셔야 합니다.

이렇게 수동으로 설정해 주시거나 다음 파일을 받으신 뒤 실행합니다.

terminal 설정 파일 다운로드



참고:
http://theeye.pe.kr/entry/how-to-mapping-keyboard-home-end-pgup-pgdown
http://fplanque.com/dev/mac/mac-osx-terminal-page-up-down-home-end-of-line

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/09/02 16:14 2009/09/02 16:14

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , , 태그가 달려있으며,
2009/09/02 16:14에 작성되었습니다.

◀ recent : [1] : [2] : [3] : [4] : [5] : ... [24] : previous ▶

blog information

프로가 되자.
BLOG main image
빗소리를 먹는 사람.
RSS 2.0Tattertools
최근 글 최근 댓글 최근 트랙백
태그 구름사이트 링크