Git Commands
From wikidb
References
Create Repository
- On github creat a new repository - for example tb3sisters
At some point I need to do this - not sure when.
$ cd ~/catkin_ws/src/tb3sisters $ git init Initialized empty Git repository in /home/eepp/catkin_ws/src/tb3sisters/.git/ $ git remote add origin git@github.com:edcepp/tb3sisters $ git pull https://github.com/edcepp/tb3sisters
Commit and Push
$ git add launch/map.launch $ git add launch/navigation.launch $ git add launch/save.launch $ git add launch/teleop.launch $ git commit [master 911d390] Added launch scripts 4 files changed, 75 insertions(+) create mode 100644 launch/map.launch create mode 100644 launch/navigation.launch create mode 100644 launch/save.launch create mode 100644 launch/teleop.launch $ git commit -am "test comment" $ git push -u origin master Counting objects: 6, done. Compressing objects: 100% (3/3), done. Writing objects: 100% (6/6), 536 bytes | 0 bytes/s, done. Total 6 (delta 0), reused 0 (delta 0) To git@github.com:edcepp/tb3sisters 911d390..3575056 master -> master Branch master set up to track remote branch master from origin.
on client it displayed this but was ok ???
$ git push -u origin master The authenticity of host 'github.com (192.30.255.112)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts. Counting objects: 8, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (8/8), 3.64 KiB | 0 bytes/s, done. Total 8 (delta 0), reused 0 (delta 0) To git@github.com:edcepp/tb3sisters * [new branch] master -> master Branch master set up to track remote branch master from origin.
Inquiry
$ roscd host $ git ls-files CMakeLists.txt config/logitech.config.yaml launch/map.launch launch/navigation.launch launch/save.launch launch/teleop.launch package.xml scripts/map.sh scripts/nav.sh scripts/save.sh
Reset Staging Area
git reset git reset filename.txt