************************ Version control systems ************************ .. note:: Don't modify this file in RDE-Doc. Update the file in personal notes, then copy it in RDE-doc. Git ==== Pro Git book https://git-scm.com/book/en/v2 Basics ------- installation ------------- .. code-block:: bash sudo apt install git-all Configuration -------------- .. code-block:: bash git config --global user.email "abdo_sarter@hotmail.com" git config --global user.name "Abed" git config --global core.editor gedit Create new repository ---------------------- .. code-block:: bash git init git add README.md git commit -m "first commit" echo "*.o" > .gitignore git remote add origin https://github.com/abedGNU/abedGNU.github.io.git git push -u origin master fd ------------ .. code-block:: bash git config --list git status git config user.name Clone existing repository -------------------------- Clone repository :: git clone https://github.com/abedGNU/QtSnap7.git Commit and versioning ---------------------- .. code-block:: bash git status git add . git commit -m 'initial project version' git tag Ignoring files --------------- .. code-block:: bash # ignore all .a files *.a # but do track lib.a, even though you're ignoring .a files above !lib.a # only ignore the TODO file in the current directory, not subdir/TODO /TODO # ignore all files in the build/ directory build/ # ignore doc/notes.txt, but not doc/server/arch.txt doc/*.txt # ignore all .pdf files in the doc/ directory and any of its subdirectories doc/**/*.pdf Working with remote --------------------- .. code-block:: bash git remote -v git remote git fetch pb git fetch git fetch origin git remote show origin git remote rename pb paul Branching ---------- .. code-block:: bash git branch newbranch git checkout testing git checkout master Github pages ------------- Usefull commands ------------------ Check the git official book and documentation for more informations. .. code-block:: bash git status -s // short status git diff git diff --staged git add *.c git tag git tag -a v1.4 -m "my version 1.4" git show v1.4 git tag -l "v1.8.5*" git checkout 2.0.0 git push origin v1.5 git log git clone git init git pull git fetch git status git add git diff git commit git push git rm git mv git log git tag git merge git show git branch git checkout Mercurial ========= SVN - Apache SubVersion ========================