Wednesday, July 13, 2016

GITHUB(simple)


Introduction of using GITHUB.
This are some of the simple setting or tutorial of using github. I will teach you the most simple command.

I will teach you: 
Push file in, add/ delete single folder, add multiply subdirectory.

I had written a slide, please take a took at it: GITHUB_SIMPLE


1)Create a Project (we called this a repositories )
we have to create an github account first before using this.
Go to your GITHUB webpage and create a new repositories .
We can create file on GITHUB page, but i reccomend used a utiity, which I'll introuce next.

2) Utility Introduce
WHY?????
It'll be really convenient when using a utility. You doesn't have to open web browser and upload your file or create folder. Most of the people coding ir creat a project on their own local laptop or PC. We can just sync from our local to the server by typing a few comment, then that's done.

3) Types of utility
There are three type of platfrom on GITHUB, you cn used either of this.

Window 
Window Desktop Source Tree

Linux
debian/ubuntu:  apt-get install git-core
Fedora/Redhat: yum install git-core

MAC: brew install git

NOTE: In my note I'll just used linux as an example,

4) Set up

your username:
#git config --global user.name "YOUR NAME"
your email:
#git config --global user.email "YOUR EMAIL ADDRESS"

your configure
#git config user.name

5)Clone your repository into your local [command: git clone]

sample: git clone  http//github.com/xxxxx/ooooo. 

 X: your username  
0:your repository name
# under Linux utility, create a directory 
mkdir GITHUB 
# clone repository from server to local and download it. Test is repository
git clone  http//github.com/chenchih/test 

6) Commit/Git push (add a new file) add a file in your local disk. Before Git Push we have to commit first. Every time you modify a file we have to commit; commit is to write description on what you modify to let you know

#go to test and create a file
touch 123456.txt
git commit -m "add file "
git push 

7)Add /delete folder[single]

Add folder
#create new folder 
mkdir testfolder 
#also create folder in gitserver 
add 'testfolder' 
#commit it 
git commit -am "Add testfolder" 
git push 
delete Folder
#delete new folder 
rm -rf testfolder 
#also delete folder in gitserver 
git rm -rf 'testfolder' 
#commit it 
git commit -m "Removed folder from repository"
git push 


8)add entire directory

# go into folder directory 
cd testfolder 
git add *
git commit -m "with the message"
git push

9) other command

Fork: when you coworj with other people, you go to their githib, and press fork
diff: is when you modify the file, you can see what's the different between previous

Reference: 
Setting config: 
https://help.github.com/articles/remembering-your-github-username-or-email/
https://help.github.com/articles/set-up-git/

Chinese tutorial 
http://gogojimmy.net/2012/02/29/git-scenario/

Source tree tutoria Chinese
https://superbil.github.io/slide/sourcetree/#sec-1

No comments:

Post a Comment