顯示具有 Github 標籤的文章。 顯示所有文章
顯示具有 Github 標籤的文章。 顯示所有文章

2017年1月23日 星期一

2017年1月8日 星期日

[Archlinux Repository][Github] How to use github as arch repository

Please refer [PKGBUILD][Archlinux] How to make PKGBUILD to create *.pkg.tar.xz


Put all *.pkg.tar.gz together. And execute following command.
repo-add pkgbuild-current.db.tar.gz *.pkg.tar.xz
Must create a new repository on github, and create a release tag.
then upload the following files to the current tag of PKGBUILDs github repository
pkgbuild-current.db
pkgbuild-current.db.tar.gz
pkgbuild-current.files           # Don't need this file
pkgbuild-current.files.tar.gz    # Don't need this file
Reference:

2015年10月27日 星期二

[git] Local git repository push to new repository on github, and keep commit log

1. Remove remote repository
git remote rm origin

2. Go to local git repository and add remote repository of github
git remote add origin git@github.com:haha/ip.git
or
git remote add origin /home/happy/git/doc

3. Push to remote repository of github
git push --set-upstream origin master --force


Reference:

2015年3月27日 星期五

[Github] update the lastest commit of submodule

Update the lastest commit of submodule
cd framework
git checkout master
git pull
git submodule update --init --recursive

add git alias for update the lastest commit of submodule
git config --global alias.up-sub-snipmate-snippets '!f() { cd bundle/snipmate-snippets && git checkout master && git pull && git submodule update --init --recursive; }; f'

Reference:

2014年12月9日 星期二

[GitHub] How to clone the code from github

First  :
Make sure the key have post github websit.
Step 1: Check for SSH keys
cd ~/.ssh

Step 2: Generate a new SSH key
ssh-keygen -t rsa -C "your_email@example.com"

Step 3: cat ~/.ssh/id_rsa.pub
ssh-rsa AAAx3NzaC1yc2EAAAABIwAAAQEAsyKnnxxxxF0GUxxkkAkI+41FDLZXRKC6QL/GuzcheyL3tvcUNNG/GyqgBSKOglUz+MvAy9PvObOpd1wVnPvFL/djmtvxxx/do93BCqX2xxvo/5Q3xM8xxxxxxxGJ/kKsWb0+KYi8xxxxxLRKz5FQTlnE8FyungbZxxxCKNqj/3YDV13RxxG61DIJvKxx5Q== your_email@example.com
Copy the above code to following the webpage of github.
1. Go to setting page
2. Press "SSH key"
3. Press "Add SSH key"
4. Paste the above code into the column.


Step 4: Test everything out
ssh -T git@github.com

# Hi username! You've successfully authenticated, but GitHub does not

#####################################################################
Git Clone  :
Go to any folder which you want and copy any SSH clone URL (e.g. "git@github.com:martinh/libconfuse.git").
Type the following command. After that enjoy your travel around the code of open source.
git clone git@github.com:martinh/libconfuse.git

Reference :

2013年5月19日 星期日

[GitHub] How to download the file from github


[GitHub] How to download the file from github



1. Go to GitHub website

https://github.com/<UserName>



2. Choose which reporsitory you want to download

ArchLinux-auto-install-script



3. Click the file, then you can see the content of the code.

ArchLinux-auto-install-script.sh



4. At the top right corner have four button was called "Edit" "Raw" "Blame" "History".

Please press the "Raw" button.

Copy the website to the end of wget.



Example :

wget --no-check-certificate  https://raw.github.com/<UserName>/ArchLinux-auto-install-script/master/ArchLinux-auto-install-script.sh

or

wget https://raw.github.com/<UserName>/ArchLinux-auto-install-script/master/ArchLinux-auto-install-script.sh


2013年5月17日 星期五

[GitHub] How to upload the code to github

[GitHub] How to upload the code to github

First  :
Make sure the key have post github websit.
Step 1: Check for SSH keys
cd ~/.ssh

Step 2: Generate a new SSH key
ssh-keygen -t rsa -C "your_email@example.com"

Step 2-2: Then add your new key to the ssh-agent:
ssh-add id_rsa

Step 3: Add your SSH key to GitHub
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub

Step 4: Test everything out
ssh -T git@github.com

# Hi username! You've successfully authenticated, but GitHub does not provide shell access.

#####################################################################
Second  :
Start to upload the code to github.
Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:freeman2004/test.git
git push -u origin master

Push an existing repository from the command line
git remote add origin git@github.com:freeman2004/test.git
git push -u origin master
#####################################################################

Q:
 ! [rejected]        master -> master (non-fast-forward)
A:
git pull -u origin master    <-- Pull the master branch from github

Reference :