To backup my arduino sketches I will use a remote git repository hosted on my own server. So lets start
- git init – initialize a new local repository
- git clone
@ : – check out/clone from a remote reporitory
The local repo is devided into a working copy, the index as interim stage und the head which is a link to the last commit.
- git add
– add a file to local repository - git commit -m “
“ - git push origin master – sync local repository with remote repo
If the local repo was not cloned but should be linked to a remote repository use:
- git remote add origin
To sync the local repository use:
- git pull – fetch remote changes and merge them with the local files
- git add
– inform git about solved merge problems after solving
Summary:
git init
git add .
git commit -am “
git remote add origin
git push -u