DON'T PANIC

Archive for September 2011

1. Install packages
# apt-get update & apt-get install git;

2. Clone a existing repository.
2.1 In that case, I will clone WINE 🙂 so, as regular user execute following commands:
taking into account have the necessary permissions on the path where you can close the repository
$ cd /srv/
$ git clone git://source.winehq.org/git/wine.git ~/wine-git
Cloning into /home/bcls/wine-git...
remote: Counting objects: 616281, done.
remote: Compressing objects: 100% (103345/103345), done.
Receiving objects: 100% (616281/616281), 115.02 MiB | 190 KiB/s, done.
Resolving deltas: 100% (511493/511493), done

2.2 Create a file, then adding to Git’s control.
bcls@eulogia:/srv/wine-git$ vi compile_wine

2.3 Following commands indicates that Git doesn’t know about lats file added
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# compile_wine
nothing added to commit but untracked files present (use "git add" to track)

2.4 Adding last file to Git’s control and check its status
bcls@eulogia:/srv/wine-git$ git add compile_wine
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# new file: compile_wine
#
bcls@eulogia:/srv/wine-git$ git commit
[master 0bb324e] Agrego script de compilacion de wine
Committer: bcls
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 files changed, 27 insertions(+), 0 deletions(-)
create mode 100755 compile_wine
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
bcls@eulogia:/srv/wine-git$ git list
git: 'list' is not a git command. See 'git --help'.

Did you mean one of these?
bisect
rev-list

2.5 Creating a separated branch under the original repository
bcls@eulogia:/srv/wine-git$ git branch
* master

2.6 Taking a look to logs from the last created branch
bcls@eulogia:/srv/wine-git$ git log
commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966
Author: bcls
Date: Fri Sep 30 18:27:02 2011 -0300

Agrego script de compilacion de wine

commit fdda702acd1a9ace6925845ec50edcf5e1023c79
Author: Andrew Eikum
Date: Wed Sep 28 13:32:03 2011 -0500

wineoss.drv: Use a temporary OSS device to check format support.

...............
...............

2.7 Creating a new branch
bcls@eulogia:/srv/wine-git$ git branch test

List all branches inside the repository
bcls@eulogia:/srv/wine-git$ git branch
* master
test

Got to last branch inside the original repository
bcls@eulogia:/srv/wine-git$ git checkout test
Switched to branch 'test'

Following command check in wich branch I am
bcls@eulogia:/srv/wine-git$ git branch
master
* test

2.8 List all branches: remote and local
bcls@eulogia:/srv/wine-git$ git branch -a
master
* test
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/stable

2.9 Removing last branch created and check it

bcls@eulogia:/srv/wine-git$ git branch -D test
Deleted branch test (was 0e72807).
bcls@eulogia:/srv/wine-git$ git branch
* master
bcls@eulogia:/srv/wine-git$ git log
commit 0e7280782eeefff079aaf633f39ff9000032ab53
Author: bcls
Date: Fri Sep 30 18:43:38 2011 -0300

Agrego archivo para probar funcionamiento de git en dif. branches

commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966
Author: bcls
Date: Fri Sep 30 18:27:02 2011 -0300

Agrego script de compilacion de wine

2.10 Revert last file created on previuos existing test branch, now this branch doesn’t exist anymore, but its content is part of master branch.

bcls@eulogia:/srv/wine-git$ git revert -s 0bb324e791c7ba941cef5d3d129f56a8a4a36966
[master f2998b7] Revert "Agrego script de compilacion de wine"
Committer: bcls
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 files changed, 0 insertions(+), 27 deletions(-)
delete mode 100755 compile_wine
bcls@eulogia:/srv/wine-git$ git log
commit f2998b78a818284566e0606f5bd25a991e757aa1
Author: bcls
Date: Fri Sep 30 18:53:40 2011 -0300

Revert "Agrego script de compilacion de wine"

This reverts commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966.

Signed-off-by: bcls

commit 0e7280782eeefff079aaf633f39ff9000032ab53
Author: bcls
Date: Fri Sep 30 18:43:38 2011 -0300

Agrego archivo para probar funcionamiento de git en dif. branches

commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966
Author: bcls
Date: Fri Sep 30 18:27:02 2011 -0300

Agrego script de compilacion de wine

commit fdda702acd1a9ace6925845ec50edcf5e1023c79
Author: Andrew Eikum
Date: Wed Sep 28 13:32:03 2011 -0500

bcls@eulogia:/srv/wine-git$ ls archivo
archivo
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
nothing to commit (working directory clean)
bcls@eulogia:/srv/wine-git$ git --help revert
bcls@eulogia:/srv/wine-git$ git branch
* master

After doing that compile_wine file doesn’t exist anymore.

bcls@eulogia:/srv/wine-git$ git revert f2998b78a818284566e0606f5bd25a991e757aa1
[master d4c8a1b] Revert “Revert “Agrego script de compilacion de wine””
Committer: bcls
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config –global user.name “Your Name”
git config –global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit –amend –reset-author

1 files changed, 27 insertions(+), 0 deletions(-)
create mode 100755 compile_wine

bcls@eulogia:/srv/wine-git$ git log
commit d4c8a1b2115b04eac56df70076638fe58326181b
Author: bcls
Date: Fri Sep 30 18:56:43 2011 -0300

Revert “Revert “Agrego script de compilacion de wine””

This reverts commit f2998b78a818284566e0606f5bd25a991e757aa1.

commit f2998b78a818284566e0606f5bd25a991e757aa1
Author: bcls
Date: Fri Sep 30 18:53:40 2011 -0300

Revert “Agrego script de compilacion de wine”

This reverts commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966.

Signed-off-by: bcls

commit 0e7280782eeefff079aaf633f39ff9000032ab53
Author: bcls
Date: Fri Sep 30 18:43:38 2011 -0300

Agrego archivo para probar funcionamiento de git en dif. branches

commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966

3. Create an initial repository
3.1 Create repository’s directory

bcls@eulogia:/srv/repositorios$ mkdir debian-packaging

3.2 Convert debian-packaging directory in a repository

bcls@eulogia:/srv/repositorios$ git init debian-packaging/
Initialized empty Git repository in /srv/repositorios/debian-packaging/.git/
bcls@eulogia:/srv/repositorios$ git status
fatal: Not a git repository (or any of the parent directories): .git
bcls@eulogia:/srv/repositorios$ cd debian-packaging/
bcls@eulogia:/srv/repositorios/debian-packaging$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)

Taking into account that ones a file is added you already can see the branch: “Master”

bcls@eulogia:/srv/repositorios/debian-packaging$ git branch
bcls@eulogia:/srv/repositorios/debian-packaging$ touch file
bcls@eulogia:/srv/repositorios/debian-packaging$ git add file
bcls@eulogia:/srv/repositorios/debian-packaging$ git commit file
bcls@eulogia:/srv/repositorios/debian-packaging$ git status
# On branch master
nothing to commit (working directory clean)
bcls@eulogia:/srv/repositorios/debian-packaging$ git branch
* master

Advertisements


  • analialorenzatto: Buzz is just a host name for this example, it doesn't have any relation to the topic. Instead of being "Buzz", could be whatever name.
  • fridelain: >buzz What's the story behind this host name? Actully running buzz, once running buzz and upgraded many times since, or unrelated to debian naming
  • Pratik: Nice, but I would change it to include more directories. Like my .mozilla and .kde4 by using .{config,mozilla,kde4} instead of just .config .

Categories