All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server > Loadtest gatling.io knowledge

github clone push เกี่ยวกับ git รวมทุกอย่าง

(1/2) > >>

golfreeze:
ถ้าทำการ สั่ง ให้ push ทุกไฟล์ขึ้นไปบน github ของ account เรา แล้วมี error

$git remote -v
แล้วไม่มีแสดงขึ้นมา แสดงว่ายังไม่ได้ remote เข้า repo ของ account นั้นๆ
$git remote add origin https://github.com/golfreeze

แล้วสั่งอีกรอบ ก็จะเจอละครับผม : )
#:~/Mygit/.git$ git remote -v
origin  https://github.com/golfreeze (fetch)
origin  https://github.com/golfreeze (push)

ถ้าจะ rename repo ก็
$git remote set-url origin https://github.com/golfreeze/NagiosPacketNrpe

$ git remote -v
origin https://github.com/golfreeze/NagiosPacketNrpe (fetch)
origin  https://github.com/golfreeze/NagiosPacketNrpe (push)


หรือทำการลบ remote origin ก็
$git remote remove origin

แล้วทำการแอดใหม่ก็ได้ตามนี้ครับ
$git remote add origin https://github.com/golfreeze/NagiosPacketNrpe.git

หลังจากนั้นทำการออกมาจาก .git folder
$cd ..
$git pull origin master
จะทำการดึงไฟล์มาจาก repo เราก่อน หลังจากนั้นค่อยทำการ push file ขึ้นไปในนั้น
$git push origin master

เท่านี้ก็เรียบร้อยครับ ทำการอัฟโหลดไฟล์จาก เครื่องเราขึ้น github ของ account เราเรียบร้อย : )

reference : http://stackoverflow.com/questions/15437719/git-push-error-origin-does-not-appear-to-be-a-git-repository

//choose folder to update file to github
git add --all
git commit -am 'EXCL'
git push

//if fail to push try to force
git push --set-upstream origin master -f

golfreeze:
##ทำการสร้าง folder Mygit ใน account เรา
$git init Mygit
$cd Mygit

ทำการ clone จาก https://github.com/gurayyarar/AdminBSBMaterialDesign/
$git clone https://github.com/gurayyarar/AdminBSBMaterialDesign/

ก็จะได้ folder "AdminBSBMaterialDesign" มาครับผม

golfreeze:
https://help.github.com/articles/importing-a-git-repository-using-the-command-line/
https://help.github.com/articles/cloning-a-repository/

golfreeze:
ถ้าทำการ สั่ง ให้ push ทุกไฟล์ขึ้นไปบน github ของ account เรา แล้วมี error

$git remote -v
แล้วไม่มีแสดงขึ้นมา แสดงว่ายังไม่ได้ remote เข้า repo ของ account นั้นๆ
$git remote add origin https://github.com/golfreeze

แล้วสั่งอีกรอบ ก็จะเจอละครับผม : )
#:~/Mygit/.git$ git remote -v
origin  https://github.com/golfreeze (fetch)
origin  https://github.com/golfreeze (push)

ถ้าจะ rename repo ก็
$git remote set-url origin https://github.com/golfreeze/NagiosPacketNrpe

$ git remote -v
origin https://github.com/golfreeze/NagiosPacketNrpe (fetch)
origin  https://github.com/golfreeze/NagiosPacketNrpe (push)


หรือทำการลบ remote origin ก็
$git remote remove origin

แล้วทำการแอดใหม่ก็ได้ตามนี้ครับ
$git remote add origin https://github.com/golfreeze/NagiosPacketNrpe.git

หลังจากนั้นทำการออกมาจาก .git folder
$cd ..
$git pull origin master
จะทำการดึงไฟล์มาจาก repo เราก่อน หลังจากนั้นค่อยทำการ push file ขึ้นไปในนั้น
$git push origin master

เท่านี้ก็เรียบร้อยครับ ทำการอัฟโหลดไฟล์จาก เครื่องเราขึ้น github ของ account เราเรียบร้อย : )

reference : http://stackoverflow.com/questions/15437719/git-push-error-origin-does-not-appear-to-be-a-git-repository

golfreeze:
โจทย์คือ ถ้าต้องการ อัฟโหลดไฟล์ใหม่ หรือแก้ไขไฟล์เดิมเสร็จแล้ว  ขึ้นไปยัง repo ที่มีอยู่แล้ว ของเรา

เริ่มแรกเข้าไปยัง git folder ใน pc หรือ mac เราครับ
ไฟล์สมมุติ ชื่อเป็น check_eximmailqueue

$git add check_eximmailqueue
$git commit -m 'up check_eximmailqueue_new_version_2016'
$git push origin master
ทำการใส่ login ของเรา

เท่านี้ก็เรียบร้อยแล้วครับผม : )
ทำการเชคใน github ของเราก็จะเจอไฟล์พร้อมกับ ค่าที่ commit ไปว่า up check_eximmailqueue_new_version_2016
ไม่ยากเลยนะครับผม ลองเล่นกันดูนะครับ เหล่า dev ทั้งหลาย : )

reference : https://help.github.com/articles/adding-a-file-to-a-repository-from-the-command-line/

นำร่อง

[0] ดัชนีข้อความ

[#] หน้าถัดไป

Go to full version