GIT Basics - AtlantsEmbedded/IntelliPi GitHub Wiki

What is GIT

In the simplest of terms, it is a way to store, track and modify changes to code and information stored within this project (or repository). Ignoring the fine details of what GIT is or how it works (if you want to learn more go here).

How do we use GIT?

We use it with the project as a way to track all of our changes (future and past), while being able to distribute them for everyone - in the most open way. Effectively, the IntelliPi project uses it to track our source-code, buildroot, and the feeds OpenWRT depends on. It is also very useful for tracking changes to tickets for bugs or the addition of new features.

How do you use it with your code/package?

When learning a new technology, focus not on the how the specific technology performs the task, but the task itself you want to perform - i.e. how do I add a new file to the repo and commit/push it?

How do I get the initial code?

Use the command:

git clone https://<your repo url>.git

How do I update my cloned code?

Use the command:

git pull

How do I add a file and commit it?

Use the following commands:

git add

git commit

git push

Then enter your commit details, username, password as directed.

How do I delete a file and commit the change?

Use the following commands:

git rm <yourFile>

git commit

git push

How do I revert all of my changes?

If you want a heavy handed approach, you can do the following:

git revert <commit>

Avoid git reset as you can cause alot of disruption For more information about resetting and reverting, go to here

⚠️ **GitHub.com Fallback** ⚠️