메뉴 건너뛰기

컴' 게시판

본문시작

IT/개발
2012.08.24 11:33

Git

조회 수 103 추천 수 0 댓글 0

Git – setting up a remote repository and doing an initial “push”

There is a great deal of documentation and many posts on Git out there, so this is more of a note to self as I keep forgetting the steps needed to set up a remote repository and doing an initial “push”.

So, firstly setup the remote repository:

ssh git@example.com
mkdir my_project.git
cd my_project.git
git init --bare
git-update-server-info # If planning to serve via HTTP
exit

On local machine:

cd my_project
git init
git add *
git commit -m "My initial commit message"
git remote add origin git@example.com:my_project.git
git push -u origin master

Done!

Team members can now clone and track the remote repository using the following:

git clone git@example.com:my_project.git
cd my_project

Bonus

To have your terminal prompt display what branch you are currently on in green, add the following to your ~/.bash_profile:

function parse_git_branch_and_add_brackets {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ [1]/'
}
PS1="h:W u[33[0;32m]$(parse_git_branch_and_add_brackets) [33[0m]$ "

  1. 14
    Nov 2012
    10:28

    JavaScript 압축 도구

    CategoryIT/개발 By꿈자 Reply0 Views11 Votes0
    Read More
  2. 13
    Nov 2012
    17:57

    아이패드 미니에 나오는 광...

    Category개인자료 By꿈자 Reply0 Views2059187 Votes0
    Read More
  3. 09
    Nov 2012
    11:11

    IMG태그에 바이러리로 이미...

    CategoryIT/개발 By꿈자 Reply0 Views15 Votes0
    Read More
  4. 31
    Oct 2012
    16:41

    Node.js 한글문서

    CategoryIT/개발 By꿈자 Reply0 Views40151 Votes0
    Read More
  5. 30
    Oct 2012
    14:58

    성능테스트툴 jMeter

    CategoryIT/개발 By꿈자 Reply0 Views69 Votes0
    Read More
  6. 12
    Oct 2012
    16:49

    Mac OS X Lion에 wget 설치

    CategoryIT/개발 By꿈자 Reply0 Views50 Votes0
    Read More
  7. 04
    Oct 2012
    13:12

    아스키 특수문자 표

    CategoryIT/개발 By꿈자 Reply0 Views39 Votes0
    Read More
  8. 06
    Sep 2012
    18:01

    iOS 개발 관련 사이트

    CategoryIT/개발 By꿈자 Reply0 Views7 Votes0
    Read More
  9. 24
    Aug 2012
    11:33

    Git

    CategoryIT/개발 By꿈자 Reply0 Views103 Votes0
    Read More
  10. 10
    Aug 2012
    15:36

    MySQL Replication

    CategoryIT/개발 By꿈자 Reply0 Views10 Votes0
    Read More
Board Pagination Prev 1 ... 13 14 15 16 17 Next
/ 17