NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Github, git note

>> Create repository <<
git init <directory> OR /directory$ git init //สำหรับสร้าง repository ในแก่ directory นั้นๆ
git clone <repository path> <directory> // clone มาใส่ใน directory
git clone <repository path> // clone มาทั้ง directory



>> Configuration <<
git config --global user.name peeratat // กำหนด username ชื่อ peeratat โดย --global คือให้ใช้ config กับทุกๆ repository ในเครื่อง
git config --global user.email [email protected] //กำ useremail ว่า peeratat1995@gmail

touch .gitignore //สร้างไฟล์ .gitignore ในตำแหน่ง root directory เพื่อให้ git ไม่ต้องสนใจไฟล์เหล่านี้
<<<ในไฟล์ .gitignore>>>
fileName.js
*.png
*.jpg



>> Save to repository <<
git add <file1> <file2> ... <fileN> // ทำการ tracking และ staging ไฟล์แต่ละไฟล์ กี่ไฟล์ก็ได้แล้วแต่เราลงใน repository
git add -u // ทำการ staging ไฟล์ทุกๆไฟล์ที่ tracked อยู่แล้ว
git add -A // ทำการ tracking และ staging ไฟล์ทุกๆไฟล์ ยกเว้นไฟล์ที่ถูกignore
git add . // staging ทุกไฟล์ที่มีการเปลี่ยนแปลง
git rm <file> // delete and untrack file
git rm --cached <file> // untrack file
git reset <file> // unstage file

git commit -m "note" // snapshot ไฟล์ทุกไฟล์ที่อยู่ใน index ( อยู่ในสถานะ staged)
git commit -a -m "note" === git add -u && git commit -m "note"



>> Log and Status <<
git log // โชว์ checksum, date, note ของการ commit ก่อนหน้านี้
git status // โชว์ status ของไฟล์ต่างๆ ( ไม่รวมที่ ingnore )
git diff HEAD



>> Read old commit <<
git checkout <commit> // ย้อนกลับไปที่ commit ที่ต้องการ แต่ถ้าหากแก้ไขแล้ว commit ณ ตำแหน่งนั้นจะเป็นการแตก branch
<commit> : checksum(6+), HEAD( commit ล่าสุด ), HEAD~2 ( commit อันที่2ก่อนล่าสุด )
git checkout master // กลับไปที่ branch master
git checkout <commit> <file> // ย้อนกลับไปที่ commit ที่ต้องการแบบแยกไฟล์ ถ้าหากแก้ไขแล้ว commit ณ ตำแหน่งนั้นจะไม่แตก branch แต่ถือว่าเป็น commit ใหม่ของ branch ปัจจุบันเลย



>> Undo <<
git revert <commit> // ทำการ commit โดยยกเลิก commit <commit> ( ยกเลิก commit ที่มีอยู่ใน branch ปัจจุบัน แล้วก้าวเข้าสู่ commit ใหม่)
git reset --hard HEAD // ยกเลิกการเปลี่ยนแปลงทุกอย่างแล้วกลับไปที่ HEAD



>> Branch <<
git branch new-branch-name // create new branch
git branch-name // veiw all branch
git checkout new-branch-name // move to new-branch-name branch
>> merge <<
//on master branch
git merge new-branch-name // merge new-branch-name to master branch
git branch -d new-branch-name // delete new-branch-name branch



>> Remote <<
git remote add origin https://github.com/Rhapzody/git_tutorial.git // add remote-url name=origin=https://github.com/Rhapzody/git_tutorial.git
git remote -v // view all remote-url
git push origin master // push update to online repo. (origin=https://github.com/Rhapzody/git_tutorial.git, branch=master)
git push -u origin master // push and save origin master >> can write only git push
git pull origin master // update local repository from origin master
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.