Scenario: Git hub는 오픈기반이라서 내가 의도하지 않아도 Repo를 공개해야하고 검색이 되는 것이다. 그래서 나는 BitBuckets으로 옮기고 난뒤 remote repo의 내용을 삭제하고 싶엇는데, repo를 단순히 삭제하면 Github위키에서는 검색이 된다는 이야기가 있어서, 저장소의 내용들을 깨끗히 삭제하고싶었다.


Solution:(아래)




git 기본 로컬 폴더 등록부터 


gitHub,bitbucket  같은 리모트 서버의 Repository와 연동까지

 

한 2시간 삽질하면서 해본것같다.


  1. /************* Github 내에 소스코드 삭제방법*********************/
  2. /*문제점: 깃허브에 저장된 폴더나 소스를 삭제할 방법을 몰라**/
  3. /*폴더를삭제하고 commit 했더니 remote와 mach가 안되서 오류가남******/
  4. /*새롭게 로컬에 똑같은 이름폴더를만들고 Merge를 하니까 해결됨****/
  5. /****************************************************************/
  6.  
  7.  
  8. /**************** github 다운받고 초기설정 방법******************/
  9.  
  10. Administrator**** MINGW64 ~/gittemp (master)
  11. git config --global user.name "*******"
  12.  
  13. Administrator**** MINGW64 ~/gittemp (master)
  14. git config --global user.email "******"
  15.  
  16. //글로벌네임 리네임 방법
  17. Administrator**** MINGW64 ~/gittemp (master)
  18. git config --global user.name *******
  19.  
  20. Administrator**** MINGW64 ~/gittemp (master)
  21. git config --list
  22. core.symlinks=false
  23. core.autocrlf=true
  24. core.fscache=true
  25. color.diff=auto
  26. color.status=auto
  27. color.branch=auto
  28. color.interactive=true
  29. help.format=html
  30. http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
  31. diff.astextplain.textconv=astextplain
  32. rebase.autosquash=true
  33. user.name=*****
  34. user.email=*********
  35.  
  36. Administrator**** MINGW64 ~
  37. mkdir gittemp
  38.  
  39. Administrator**** MINGW64 ~
  40. cd gittemp
  41.  
  42. Administrator**** MINGW64 ~/gittemp
  43. git init
  44. Initialized empty Git repository in C:/Users/Administrator/gittemp/.git/
  45.  
  46. Administrator**** MINGW64 ~/gittemp (master)
  47. touch Readme.txt
  48.  
  49. Administrator**** MINGW64 ~/gittemp (master)
  50. git status
  51. On branch master
  52.  
  53. Initial commit
  54.  
  55. Untracked files:
  56.   (use "git add <file>..." to include in what will be committed)
  57.  
  58.         Readme.txt
  59.  
  60. nothing added to commit but untracked files present (use "git add" to track)
  61.  
  62. Administrator**** MINGW64 ~/gittemp (master)
  63. git add Readme.txt
  64.  
  65. Administrator**** MINGW64 ~/gittemp (master)
  66. git commit -m "Add readme.txt"
  67.  
  68. Administrator**** MINGW64 ~/gittemp (master)
  69. git remote add origin https://github.com/****/projects.git
  70.  
  71. Administrator**** MINGW64 ~/gittemp (master)
  72. git remote -v
  73. origin  https://github.com/****/projects.git (fetch)
  74. origin  https://github.com/****/projects.git (push)
  75.  
  76. Administrator**** MINGW64 ~/gittemp (master)
  77. git remote show
  78. origin
  79.  
  80.  
  81.  
  82.  
  83. /**************************여기서부터 GitHub내 파일 삭제 완료******************************/
  84.  
  85.  
  86.  
  87. Administrator**** MINGW64 ~/gittemp (master)
  88. git push -u origin master
  89. Username for 'https://github.com': ****@gmail.com
  90. To https://github.com/****/projects.git
  91.  ! [rejected]        master -> master (non-fast-forward)
  92. error: failed to push some refs to 'https://github.com/****/projects.git'
  93. hint: Updates were rejected because the tip of your current branch is behind
  94. hint: its remote counterpart. Integrate the remote changes (e.g.
  95. hint: 'git pull ...') before pushing again.
  96. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  97.  
  98.  
  99. Administrator**** MINGW64 ~/gittemp (master)
  100. git push origin +some_branch
  101. error: src refspec some_branch does not match any.
  102. error: failed to push some refs to 'https://github.com/****/projects.git'
  103.  
  104. Administrator**** MINGW64 ~/gittemp (master)
  105. git push origin +master
  106. Username for 'https://github.com': ****@gmail.com
  107. Counting objects: 5, done.
  108. Delta compression using up to 4 threads.
  109. Compressing objects: 100% (3/3), done.
  110. Writing objects: 100% (5/5)479 bytes | 0 bytes/s, done.
  111. Total 5 (delta 1), reused 0 (delta 0)
  112. remote: Resolving deltas: 100% (1/1), done.
  113. To https://github.com/****/projects.git
  114.  + 4ebba1a...b180f2e master -> master (forced update)
  115.  



소스코드 공유시 틀 사이트는 : http://pastebin.com/index.php

여기 좋은것 같음



+ Recent posts