Categories
🏴‍☠️

How to completely clear git repository, without deleting it

f you only have a local git repository

if you want to erase your whole history and start over again:

cd <repo>
rm -rf .git
git init

and start committing again.

If you want to remove both files and history:

cd <repo>
rm -rf *
git init

and start adding files and committing…

if you are linked with a remote repository if you want to start over again, but don’t really mind some old history remaining; there is a quick way:

git pull
git rm -r *
git commit
git push

now your repository is empty again, you’ll only have some old history remaining. if you also want to clean up all your history; that takes a little more work (and note that this will cause trouble for anyone else linked to that same remote repository):

git checkout <first commit hash>
git rm -r *
touch README
git add README
git commit --amend
git push -f

note that I create a empty README file for the first commit, since a commit cannot be empty.

Categories
🏴‍☠️

How to push files to a Bitbucket.org

Choose Create repository

or Choose TeamsCreate Repository

Input data “Respository name

When complted, Choose  “I have an exiting project

copy step 2 “git remote add origin …

Download & install git  (https://git-scm.com/download/win)

Categories
Android 🏴‍☠️

สร้าง git บน Bitbucket สำหรับ Android

https://bitbucket.org/ เลือก Create repository

screen-shot-2559-10-01-at-9-32-01-am

 

screen-shot-2559-10-01-at-9-32-46-am

อันดับแรกเข้าไปใน directory แล้วจัดการ gitignore สำหรับ android ก่อน

ls -a

nano .gitignore

screen-shot-2559-10-01-at-9-56-53-am

https://github.com/github/gitignore/blob/master/Android.gitignore