Search what you want

Sunday, March 15, 2015

how to use git in ubuntu (linux)

#install git
erdearik@erdearik:~$ sudo apt-get install git
[sudo] password for erdearik:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
git is already the newest version.
git set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.




#Update repository

erdearik@erdearik:~$ sudo apt-get install update
Reading package lists... Done
Building dependency tree      
Reading state information... Done


#git config
erdearik@erdearik:~$ git config --global user.name "ardhimaarik"
erdearik@erdearik:~$ git config --global user.email "ardhimaarik@yahoo.co.id"


#show file in folder

erdearik@erdearik:~$ ls
ard.sublime-project                   MATLAB           sketchbook
ard.sublime-workspace                 Music            Templates
bin                                   My Games         Untitled Document
cara memulai budidaya ikan sidat.pdf  Pictures         Untitled Document~
Desktop                               pirobot.pdf      Videos
Documents                             Protege_4.3      workspace
Downloads                             Public           ws
examples.desktop                      PycharmProjects
kendala budidaya ikan sidat.pdf       scripts
 

#move to ws folder
erdearik@erdearik:~$ cd ws
 

#show file in folder
erdearik@erdearik:~/ws$ ls
build  include  lib  main  Makefile  Makefile~  src
 

#git init
erdearik@erdearik:~/ws$ git init
Initialized empty Git repository in /home/erdearik/ws/.git


#remote git folder
erdearik@erdearik:~/ws$ git remote add origin https://github.com/ardhimaarik/bot.git

#show status

erdearik@erdearik:~/ws$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    Makefile
    Makefile~
    build/
    include/
    lib/
    main/
    src/

nothing added to commit but untracked files present (use "git add" to track)


#commit

erdearik@erdearik:~/ws$ git add .
erdearik@erdearik:~/ws$ git commit -m "initial"
[master (root-commit) f824f35] initial
 75 files changed, 12382 insertions(+)
 create mode 100644 Makefile
 create mode 100644 Makefile~
 create mode 100644 build/libarduino-master.a
 create mode 100755 build/main.elf
 create mode 100644 build/main.hex
 create mode 100755 include/arduino/Arduino.h
 create mode 100644 include/arduino/Client.h
 create mode 100644 include/arduino/HardwareSerial.h
 create mode 100644 include/arduino/IPAddress.h
 create mode 100644 include/arduino/Platform.h
 create mode 100755 include/arduino/Print.h
 create mode 100644 include/arduino/Printable.h
 create mode 100644 include/arduino/Server.h
 create mode 100644 include/arduino/Stream.h
 create mode 100644 include/arduino/USBAPI.h
 create mode 100644 include/arduino/USBCore.h
 create mode 100644 include/arduino/USBDesc.h
 create mode 100644 include/arduino/Udp.h
 create mode 100644 include/arduino/WCharacter.h
 create mode 100644 include/arduino/WString.h
 create mode 100644 include/arduino/Wire.h
 create mode 100644 include/arduino/binary.h
 create mode 100644 include/arduino/new.h
 create mode 100644 include/arduino/pins_arduino.h
 create mode 100644 include/arduino/twi.h
 create mode 100755 include/arduino/wiring_private.h
 create mode 100644 lib/libarduino-master.a
 create mode 100644 main/master.cc
 create mode 100755 src/arduino/Arduino.h
 create mode 100644 src/arduino/CDC.cpp
 create mode 100644 src/arduino/Client.h
 create mode 100644 src/arduino/HID.cpp
 create mode 100644 src/arduino/HardwareSerial.cpp
 create mode 100644 src/arduino/HardwareSerial.h
 create mode 100644 src/arduino/IPAddress.cpp
 create mode 100644 src/arduino/IPAddress.h
 create mode 100644 src/arduino/Platform.h
 create mode 100755 src/arduino/Print.cpp
 create mode 100755 src/arduino/Print.h
 create mode 100644 src/arduino/Printable.h
 create mode 100644 src/arduino/README
 create mode 100644 src/arduino/Server.h
 create mode 100644 src/arduino/Stream.cpp
 create mode 100644 src/arduino/Stream.h
 create mode 100755 src/arduino/Tone.cpp
 create mode 100644 src/arduino/USBAPI.h
 create mode 100644 src/arduino/USBCore.cpp
 create mode 100644 src/arduino/USBCore.h
 create mode 100644 src/arduino/USBDesc.h
 create mode 100644 src/arduino/Udp.h
 create mode 100644 src/arduino/WCharacter.h
 create mode 100644 src/arduino/WInterrupts.c
 create mode 100644 src/arduino/WMath.cpp
 create mode 100644 src/arduino/WString.cpp
 create mode 100644 src/arduino/WString.h
 create mode 100644 src/arduino/Wire.cpp
 create mode 100644 src/arduino/Wire.h
 create mode 100644 src/arduino/avr-libc/malloc.c
 create mode 100644 src/arduino/avr-libc/realloc.c
 create mode 100644 src/arduino/avr-libc/sectionname.h
 create mode 100644 src/arduino/avr-libc/stdlib_private.h
 create mode 100644 src/arduino/binary.h
 create mode 100644 src/arduino/main.cpp
 create mode 100644 src/arduino/new.cpp
 create mode 100644 src/arduino/new.h
 create mode 100644 src/arduino/pins_arduino.c
 create mode 100644 src/arduino/pins_arduino.h
 create mode 100644 src/arduino/twi.c
 create mode 100644 src/arduino/twi.h
 create mode 100644 src/arduino/wiring.c
 create mode 100644 src/arduino/wiring_analog.c
 create mode 100644 src/arduino/wiring_digital.c
 create mode 100755 src/arduino/wiring_private.h
 create mode 100755 src/arduino/wiring_pulse.c
 create mode 100755 src/arduino/wiring_shift.c
 

#push file to github
erdearik@erdearik:~/ws$ git push -u orgin master
Username for 'https://github.com': ardhimaarik
Password for 'https://ardhimaarik@github.com':
Counting objects: 63, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (59/59), done.
Writing objects: 100% (63/63), 107.48 KiB | 0 bytes/s, done.
Total 63 (delta 2), reused 0 (delta 0)
To https://github.com/ardhimaarik/bot.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from orgin.



#finish

No comments:

Post a Comment