zeldor.biz

Linux, programming and more

Copyright © 2023
Log in

git diff side-by-side

September 30, 2019 by Igor Drobot Leave a Comment

During committing of larger feature over GIT, I recognised a need to perform a side by side diffs instead the typical line-in-line diffs which are default by running git diff or the same line-by-line diff which is provided by the Fork.app

However you can do side-by-side diffs with git!

[Read more…]

Filed Under: Linux Tagged With: developer, GIT

Second chance: etckeeper

February 1, 2011 by Igor Drobot Leave a Comment

Etckeeper is a useful tool to store /etc in a version control system. It allows you to read the changes that have been made to the files in /etc, document these changes and recover a previous version of a modified file in case we made some changes that we don’t want to keep. It’ s a great system to control your server and find very quickly solutions.

Its installation is very trivial:

1
aptitude install etckeeper

aptitude install etckeeper

[Read more…]

Filed Under: Bash, Debian, Linux Tagged With: Etckeeper, GIT

Alternative Git logo and favicon

June 16, 2010 by Igor Drobot Leave a Comment

I came up with some pretty nice logos and favicons for GIT:


Favicon: ()

The default logo and favicon for GIT/gitweb are GIT and gitweb


Some other icons:
Git LogoGit Cube

Filed Under: Linux Tagged With: GIT, git logo

GIT Version Control System

June 16, 2010 by Igor Drobot Leave a Comment

GIT is one of the best systems for version control. I don’t want talk about benefits or other things now. I tell you how to work with GIT and do really useful things with it. Very simple installation and a list of frequently used commands:







Install GIT: (You see It’s very easy)

1
apt-get update && apt-get install git-core

apt-get update && apt-get install git-core

Create new git repository:

2
git init

git init

Add all changes to repository:

3
git add .

git add .

Consolidation of all changes:

4
git commit -a

git commit -a

Consolidation of all changes with commit message:

5
git commit -a -m "Commit Message"

git commit -a -m "Commit Message"

Revert last commit:

6
git reset --soft HEAD^

git reset --soft HEAD^

Current working directory status:

7
git status

git status

Diff since last commit:

8
git diff

git diff

Add link to remote repository:

9
git remote add origin ssh://id@gitcher/opt/repository

git remote add origin ssh://id@gitcher/opt/repository

Remove link to remote repository:

10
git remote rm origin

git remote rm origin

Get all new versions from source(remote repository):

11
git pull origin master

git pull origin master

Push all new changes to source(remote repository):

12
git push origin master

git push origin master

Create new working tree(branch):

13
git branch branch_name

git branch branch_name

Change between branches:

14
git checkout branch_name

git checkout branch_name

Merge braches:

15
git merge branch_name

git merge branch_name

Delete branch:

16
git branch -d branch_name

git branch -d branch_name

Remove branch force:

17
git branch -D branch_name

git branch -D branch_name





And more complicated examples
Create local working space and push all changes to remote repository:

1
2
3
4
5
6
git init
touch Initial_File
git add Initial_File
git commit -a -m "Initial commit"
git remote add origin ssh://id@gitcher/opt/repository
git push origin master

git init touch Initial_File git add Initial_File git commit -a -m "Initial commit" git remote add origin ssh://id@gitcher/opt/repository git push origin master



Create brach, edit and merge:

1
2
3
4
5
6
7
8
9
10
git init
git branch test
git checkout test
# ...
# add changes
# ...
git commit -a -m "Branch commit"
git checkout
git merge test
git branch -d test

git init git branch test git checkout test # ... # add changes # ... git commit -a -m "Branch commit" git checkout git merge test git branch -d test

Messed up the last commit message? This will let you re-enter it:

1
git commit --amend

git commit --amend

GIT Tagging
for example you want to release a new version of your project:

1
git tag -a v0.1 -m 'Intitial tag vesrion 0.1'

git tag -a v0.1 -m 'Intitial tag vesrion 0.1'

Clone remote repositoty

1
git clone id@gitche:scripts.git

git clone id@gitche:scripts.git

Filed Under: Linux Tagged With: Control, create branch, create repository, Debian, GIT, git commit, Linux