Install git
Install
sudo apt install git
git --version
Config
git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"
git config --list
less ~/.gitconfig # ~/ means home directory
Repository init
cd ~/Documents
mkdir gittest
cd gittest/
git init
ls -la
touch test.txt
echo "git test" > test.txt
git status
# No commits yet ... Untracked files: ...
git add .
git commit -a -m "First commit"
git status
# On branch master nothing to commit, working tree clean
Export modified files
.git/config
[alias]
exportmdf = "!f() { \
git diff --stat @{`date +\"%Y-%m-%d\"`} --diff-filter=ACRMRT --name-only | xargs tar -cf /d/htdocs/refresh.local/refresh.ro/_diff/`date +\"%Y-%m-%d\".}}tar; \
tar -o -xvf /d/htdocs/refresh.local/refresh.ro/_diff/`date +\"%Y-%m-%d\".}}tar --directory /d/htdocs/refresh.local/refresh.ro/_diff/Application/; \
git commit -a -m 'commit automat exportmdf'; \
}; f"
Open in directory
Open terminal in specific directory
sudo gedit .bashrc
# add line
cd /home/catalin/m9App
# m9App -> /var/www/site.local/Application/ (symlink)
Last update: 629 days ago
Questions and answers
Install git
- a) sudo apt install git
- b) sudo git install
Check git installation
- a) git status
- b) git --version