Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 03 Mar 2015, 07:33
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Howto git PART 1
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [38 Posts]   Goto page: 1, 2, 3 Next
Author Message
Karl Godt


Joined: 20 Jun 2010
Posts: 4005
Location: Kiel,Germany

PostPosted: Tue 17 Dec 2013, 18:11    Post subject:  Howto git PART 1
Subject description: Using git
 

As many have recognized, there is

https://github.com/puppylinux-woof-CE

Since there are not many contributors, I would like to give a tutorial about how to use it .

First , you'll need the git package installed, should be part of most common devx_puppy-version.sfs .

Second , open a console urxvt or xterm window in your preferred home directory and type
Code:
mkdir puppylinux-woof-CE.d

Then change into that new created directory :
Code:
cd puppylinux-woof-CE.d


Third - now the git part begins .
Type
Code:
git init
which will answer
initialized empty Git repository in /root/puppylinux-woof-CE.d/.git/

then type
Code:
git remote add woofce https://github.com/puppylinux-woof-CE/woof-CE
which will answer nothing

then type
Code:
git pull woofce
that will download the woof and print into the terminal like :
Code:
remote: Counting objects: 9530, done.
remote: Compressing objects: 100% (4818/4818), done.
remote: Total 9530 (delta 3973), reused 9071 (delta 3531)
Receiving objects: 100% (9530/9530), 19.89 MiB | 388.00 KiB/s, done.
Resolving deltas: 100% (3973/3973), done.
From https://github.com/puppylinux-woof-CE/woof-CE
 * [new branch]      firmware   -> woofce/firmware
 * [new branch]      master     -> woofce/master
 * [new branch]      testing    -> woofce/testing
From https://github.com/puppylinux-woof-CE/woof-CE
 * [new tag]         0.1        -> 0.1
 * [new tag]         woof-CE-0.1 -> woof-CE-0.1
You asked to pull from the remote 'woofce', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.


Fourth , it ineeds to initialize the branches :
Code:
git checkout firmware
will answer
Branch firmware set up to track remote branch firmware from woofce.
Switched to a new branch 'firmware'


and in the filer window you will see the created file and folder tree .

This has to be done for master and testing branches, too :
Code:
git checkout testing

Branch testing set up to track remote branch testing from woofce.
Switched to a new branch 'testing'

Code:
 git checkout master

Branch master set up to track remote branch master from woofce.
Switched to a new branch 'master'



#*** END of LESSON PART 1

Questions ?
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4005
Location: Kiel,Germany

PostPosted: Tue 17 Dec 2013, 20:31    Post subject:  

Continues here :
Howto git PART 2

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11272
Location: Arizona USA

PostPosted: Tue 17 Dec 2013, 21:34    Post subject:  

Thanks for the How-To. Maybe the reason there aren't many contributors is that very few people know what git is or what it might be good for. For sure I don't have a clue. Confused
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4005
Location: Kiel,Germany

PostPosted: Tue 17 Dec 2013, 22:36    Post subject:  

Flash wrote:
Thanks for the How-To. Maybe the reason there aren't many contributors is that very few people know what git is or what it might be good for. For sure I don't have a clue. Confused

Yup, for the average user means git, svn or cvs are just tools to download something that just does never compile anyway .

Smile
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 2127

PostPosted: Wed 18 Dec 2013, 01:47    Post subject:  

Flash wrote:
Thanks for the How-To. Maybe the reason there aren't many contributors is that very few people know what git is or what it might be good for. For sure I don't have a clue. Confused


Git is a versioning system. ie it keeps track of the changes you make in a file or in a folder so you can know what is changed and why, and provide and easy way to go back if something is wrong or identify what exactly generated a problem.
There are many of these system. svn, mercurial and git are the most used. BarryK himself first created bones and then used fossil to track changes in woof development.
Git is arguably the most powerful of all and geared much more for collaboration with a lot of new features. The linux kernel and many other major projects use it.
Github is a web repository and interface for git-based projects, like woof-CE.

Oversimplifying, for the avid puppean it means in that instead of suggesting specific code changes in the forum can do that in git/github and a) make the life of a pupplet developer easier and b) get his/her name on the record. Wink
For the pupplet developer, it means that whatever changes where made in the woof code can be shared with all the other developers easily and advance puppy in general.

In a nutshell, is something that makes it easy and efficient for people to truly collaborate in a project (in puppy "community edition" for example)

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 664
Location: Brisbane, Australia

PostPosted: Sun 19 Oct 2014, 15:33    Post subject:  

deleted
gyro
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 595
Location: The other Mr. 305

PostPosted: Tue 11 Nov 2014, 22:54    Post subject:  

Steps above lead to "Unable to Access 'https://github.com/puppylinux-woof-CE/woor-CE/': Problem with the SSL CA cert (path? access rights?)

Are others seeing this issue?
Back to top
View user's profile Send private message 
nilsonmorales


Joined: 15 Apr 2011
Posts: 613
Location: El Salvador

PostPosted: Wed 12 Nov 2014, 00:08    Post subject:  

slavvo67
I use this script by D-coy
Code:
#!/bin/sh
#Script para automatizar configuración de git y clonar repositorios remotos
#27122013 Escritor por D-coy
#27122013, GPL3 (/usr/share/doc/legal)
#27122013 nilsonmorales lineas de ayuda

# Configure user and mail

echo -n 'Enter your User: '
read user
if git config --global user.name $user 2>/dev/null ; then
git config --global user.name $user
     
echo -n 'Enter your Mail: '
read mail
git config --global user.email $mail

#General Config
     
git config --global core.editor geany
git config --global core.pager ''
git config --global color.ui true
git config --global http.sslVerify false
git config --global push.default matching
git config --global push.default simple
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
echo -n "Do you want to clone a git project? s/n: "
read clone
if [ "$clone" == "s" ]; then

#Type repo/project link
#Example: https://github.com/nilsonmorales/Badass

echo -n "URL to clone: "
read repo
git clone $repo
fi
else
echo 'You need "git" installed...'   
exit
fi


The git config --global http.sslVerify false line help me to pass the SSL CA cert

_________________
My blog


Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 664
Location: Brisbane, Australia

PostPosted: Wed 12 Nov 2014, 07:44    Post subject:  

slavvo67 wrote:
Steps above lead to "Unable to Access 'https://github.com/puppylinux-woof-CE/woor-CE/': Problem with the SSL CA cert (path? access rights?)

Are others seeing this issue?
Yes.
After
Code:
git init
enter the following command
Code:
git config --global http.sslverify false
as alluded to by nilsonmorales.

gyro
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 596
Location: Japan

PostPosted: Sun 11 Jan 2015, 01:18    Post subject:  

I feel very stupid. I've read step1-3, I created an account and I've downloaded puppylinux-woof-CE.d to my local HD. Now what? Still I can't figure out how to proceed.

This local puppylinux-woof-CE.d contains what status? It appears that the committed changes I see at Github are not included and that I instead have a copy of the same files that are contained in my Slacko 5.9. If that's true, wouldn't I then work on outdated files? And if it's not true, how do I make sure that my local copy is synced with the Github version?

How can I - in practical terms - change, test and upload a patch to Github? Let's say I want to patch the file /usr/local/petget/installpkg.sh. So I find the file in in my local ../puppylinux-woof-CE.d/woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh.
My local ../puppylinux-woof-CE.d/ is just a bunch of files sitting on my HD, it's not a live productive environment and it's not a testing environment, so what is it? For making changes to a file I first need to have a test copy. Where do I put it? And when I have it, how do I test it "live"? I can always temporarily rename the current /usr/local/petget/installpkg.sh and replace it with my test copy. When I'm done I can save the changed file "somewhere" for later uppload to Github and rename the original /usr/local/petget/installpkg.sh. Sounds already terribly wrong.... Crying or Very sad
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 664
Location: Brisbane, Australia

PostPosted: Sun 11 Jan 2015, 05:58    Post subject:  

MochiMoppel wrote:
I feel very stupid. I've read step1-3, I created an account and I've downloaded puppylinux-woof-CE.d to my local HD. Now what? Still I can't figure out how to proceed.
Join the club.
I've never been able to get Karl's method to work, i.e. where I could issue a pull request.
I used the following cheat sheet:
Code:
On github:
 fork woof-CE.

In my git directory:
 git init
 git config --global user.email euser@yahoo.com.au
 git config --global user.name ghuser
 git config --global http.sslverify false
 git clone https://ghuser@github.com/ghuser/woof-CE.git
 git remote add origin https://ghuser@github.com/ghuser/woof-CE.git
 cd woof-CE
 git checkout testing

apply patch(s) directly to local source file(s)

 git commit -a -m 'description of changes'
 git push origin testing

On github:
 create a pull request.
It may be overkill in some places, but it works for me.
Of course you need to edit "ghuser" to be your username on github, and edit the email address "euser@yahoo.com.au".

gyro

Last edited by gyro on Sun 11 Jan 2015, 06:21; edited 1 time in total
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 664
Location: Brisbane, Australia

PostPosted: Sun 11 Jan 2015, 06:20    Post subject:  

MochiMoppel wrote:
My local ../puppylinux-woof-CE.d/ is just a bunch of files sitting on my HD
Yes, what you get from git is just a directory of source files, as they currently exist in woof-CE.
MochiMoppel wrote:
For making changes to a file I first need to have a test copy. Where do I put it?
After you have created a new version of a file and tested it in your local test environment, then you compare it with the original version of the file:
Code:
diff -u filename.orig filename > filename.diff
Then you can directly "patch" the copy of the file in the git directory with "filename.diff", commit the changes, and push the modified branch back to github.

gyro
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 596
Location: Japan

PostPosted: Tue 13 Jan 2015, 05:15    Post subject:  

gyro, thank you for your kind response. I'm still not ready to cheat Laughing

gyro wrote:
Yes, what you get from git is just a directory of source files, as they currently exist in woof-CE.

So you are saying that these are the most recent files, right? But even then, if I have a local copy, this copy gets old and needs to be updated - preferable in real time. Sounds impossible. Makes me wonder why I would need a local copy at all. So I tried to do as much as possible online. To stay with my example, I just logged in to Github, went to my fork and made some changes to woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh. I then pressed "commit", believing that this would save the changes to my own forked environment.. I can see the diff between the original and my changed file. I can also comment on the changes. Are these changes visible to other members? And when I'm content with my changes, would pushing the "pull request" button initiate a ...you guess what?
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 664
Location: Brisbane, Australia

PostPosted: Tue 13 Jan 2015, 12:50    Post subject:  

MochiMoppel wrote:
Are these changes visible to other members?
The woof-CE folk won't notice them until you create a "pull request".
MochiMoppel wrote:
And when I'm content with my changes, would pushing the "pull request" button initiate a ...you guess what?
If you are happy with the diff, then try a "pull request".

I've never tried to modify my fork directly via github.
I always use a local test environment for my local version of the file. When I am happy that my changed file works, I then produce a "pull request" as outlined in my previous post, using the local changed version of the file that I used in testing.
Once the "pull request" is accepted or rejected, I delete my fork and my local clone. So next time I get a fresh fork and a fresh clone, that way I don't have to worry about keeping them updated.

Edit: I remembered why I clone a local copy of woof-ce.
I don't like to risk the possibility of introducing a typo into woof-ce by editing directly in github.
After successful testing, I "diff -u" the original version of the file with my modified version to produce a ".diff" file. I then use this ".diff" file to "patch" the woof-ce version of the file in my local git directory. Then I know that the code I tested is the code that ends up in woof-ce.

gyro
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 596
Location: Japan

PostPosted: Wed 14 Jan 2015, 02:52    Post subject:  

gyro wrote:
MochiMoppel wrote:
Are these changes visible to other members?
The woof-CE folk won't notice them until you create a "pull request".
They may not notice, but the changes seem to be visible to anyone even without creating an account. Well , that's OK, only question is if it is more desirable to ask other members for comments at this stage or after a pull request.

The next problem: Now that I have committed my change, I can't edit the file any longer. I would like to add another change. How can I do this? Uncommit? The pencil icon which let me make the first change is not active anymore... Crying or Very sad
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [38 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1164s ][ Queries: 12 (0.0055s) ][ GZIP on ]