Howto git PART 3

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

Howto git PART 3

#1 Post by Karl Godt »

Continuing from Howto git PART 2

Where are we ?
We are back in the
puppylinux-woof-CE.d
that we created at Howto git PART 1
and again in the xterminal urxvt or xterm .
# pwd
command shows
/root/puppylinux-woof-CE.d

and
# ls -1a
.
..
.git
kernel-kit
LICENSE
merge2out
README
README-FIRST
vcs-workarounds
woof-arch
woof-code
woof-distro

Code: Select all

git branch
shows
firmware
* master
testing


-- the asterix * indicating the current file status that would open in geany texteditor .

Code: Select all

git log
shows as of today

Code: Select all

commit 94a36111339d2ec03a65f44be9225b266202d56d
Author: mavrothal <mavrothal@yahoo.com>
Date:   Wed Dec 18 03:43:58 2013 +0800

    Revert "Move all-firmware to modem-firmware"
    
    This reverts commit 139c3b69a9e2b5c4a901167a891f98eda0e39df8.
less is the default git pager and I don't know any good equivalent .
Setting the pager to e3 or mp is something for masochists .


Now it is time to create a branch, let's name it playground :

Code: Select all

git branch playground
which does not respond anything to the console ..
Where are we ?
Again

git branch
firmware
* master
playground
testing

tells us we are still in master .
So on with switching to the new branch playground :

Code: Select all

git checkout playground
responds
Switched to branch 'playground'

Code: Select all

git log
again shows
commit 94a36111339d2ec03a65f44be9225b266202d56d
Author: mavrothal <mavrothal@yahoo.com>
Date: Wed Dec 18 03:43:58 2013 +0800

Revert "Move all-firmware to modem-firmware"

This reverts commit 139c3b69a9e2b5c4a901167a891f98eda0e39df8.


-- the same commit level as the branch that was switched from .

git branch again gives us the asterix * now before playground :
firmware
master
* playground
testing


Now it's about time to switch to the testing branch and delete the playground branch :

Code: Select all

git checkout testing
Switched to branch 'testing'

git log is showing
commit 9c6a9b0bce772af7b5bb473672b77a51d7abaa1e
Merge: ea14655 9132f26
Author: mavrothal <mavrothal@users.noreply.github.com>
Date: Tue Dec 17 11:48:48 2013 -0800

Merge pull request #244 from KarlGodt/mavrothal-woof-CE-testing

/usr/sbin/shutdownconfig : Handle SAVEMARK file in subdirectory

because it has a different commit level than the other branch , in this case it is further ahead .

Now about to delete the playground branch :

Code: Select all

git branch -D playground
gives us
Deleted branch playground (was 94a3611).


LAST for this lesson :
We create the playground branch again,
now from the testing branch
and submit the new branch to our fork at github.com :
# git branch
firmware
master
* testing

Code: Select all

git checkout -b playground
Switched to a new branch 'playground'
git checkout -b is short for "git branch;git checkout"

# git branch
firmware
master
* playground
testing

# git log
commit 9c6a9b0bce772af7b5bb473672b77a51d7abaa1e
Merge: ea14655 9132f26
Author: mavrothal <mavrothal@users.noreply.github.com>
Date: Tue Dec 17 11:48:48 2013 -0800

Merge pull request #244 from KarlGodt/mavrothal-woof-CE-testing

/usr/sbin/shutdownconfig : Handle SAVEMARK file in subdirectory

Code: Select all

git remote -v
tells us
woofce https://github.com/puppylinux-woof-CE/woof-CE (fetch)
woofce https://github.com/puppylinux-woof-CE/woof-CE (push)

so it needs to setup another remote - our pup-noob remote fork by

Code: Select all

git remote add pup-noob https://github.com/pup-noob/woof-CE
git remote -v again now tells us
pup-noob https://github.com/pup-noob/woof-CE (fetch)
pup-noob https://github.com/pup-noob/woof-CE (push)
woofce https://github.com/puppylinux-woof-CE/woof-CE (fetch)
woofce https://github.com/puppylinux-woof-CE/woof-CE (push)


AND NOW THE BIG MOMENT : Pushing the new branch playground to our remote fork on github.com :

Code: Select all

git push pup-noob playground
Username:
Password:
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/pup-noob/woof-CE
* [new branch] playground -> playground


GIT btw is Wary-5.5 devx.sfs loaded into current Slacko-5.6.5
# git --version
git version 1.7.5.4


And in the internet browser it shows
Attachments
new-branch-on-remote.jpg
(91.48 KiB) Downloaded 1710 times

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

push problem (solved)

#2 Post by scsijon »

I followed instructions and other than calling it playground1, it all works until we get to :

# git push pup-noob playground1
Username:
Password:
error: The requested URL returned error: 403 while accessing https://github.com/pup-noob/woof-CE/info/refs

fatal: HTTP request failed

errored as above

any ideas?

EDIT: Forget it, i've just realized that your username is pup-noob and I should have used my own login name here. Maybe it's worth highlighting that bit in case others also get confused.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#3 Post by slavvo67 »

Is there any more to this? How do you create a Puppy from here?

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#4 Post by scsijon »

slavvo67 wrote:Is there any more to this? How do you create a Puppy from here?
goto the directory structure you have just built on your local workstation and you will see it's in a woof format. From here you just follow the standard building instructions.

ie open a terminal, goto the directory you created, type ./merge2out and off you go...

peterw
Posts: 430
Joined: Wed 19 Jul 2006, 12:12
Location: UK

Final touches to get git working

#5 Post by peterw »

Hi
I am trying to get git working and fail at the final stage. The instructions are very good up to this point. Any clarification on this last bit will be useful. When I type:

git push pup-noob playtime

(I used playtime and not playground)

I get the same result as scsijon which I have copied below; however he found a way around it. I have tried various combinations of my user name instead of pup-noob but cannot get past this last hurdle.

Username:
Password:
error: The requested URL returned error: 403 while accessing https://github.com/pup-noob/woof-CE/info/refs

fatal: HTTP request failed

errored as above

any ideas?

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#6 Post by scsijon »

@peterw -

PETER YOU NEED TO USE YOUR OWN git ACCOUNT NAME NOT pup-noob. pup-noob was for explanation ONLY, NOT FOR ACTUAL USE> YOU DO NOT HAVE FULL RIGHTS TO IT, only the origonal creator has.

Set that up first and replace everywhere you see in parts 1 to 3 where it says pup-noob with your own account name and you will be ok.


@Karl, can you please make it clear from part 1 please that they need to do this, i'm also getting pm's about this.

peterw
Posts: 430
Joined: Wed 19 Jul 2006, 12:12
Location: UK

Final touches to get git working

#7 Post by peterw »

Hi scsijon

Thanks for the response. I think I have followed the instructions correctly. However, I still can't get over the final hurdle. I have attached a copy of what I see in the terminal. You can see that I tried various combinations. I must be doing something stupid. I know I can sign in to github.com with my user name and password on another computer so it can't be that. I am running out of ideas.

peterw
Attachments
Screenshot_2014-08-01_084745.png
Copy of screen showing 403 error and previous commands.
(180.1 KiB) Downloaded 364 times

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

Re: Final touches to get git working

#8 Post by scsijon »

peterw wrote:Hi scsijon

Thanks for the response. I think I have followed the instructions correctly. However, I still can't get over the final hurdle. I have attached a copy of what I see in the terminal. You can see that I tried various combinations. I must be doing something stupid. I know I can sign in to github.com with my user name and password on another computer so it can't be that. I am running out of ideas.

peterw
I had that too on the first go when i created my local git woof-CE copy when I was trying to use pup-noob! I thought that was just me as I already had git access for other projects.

I ended up by blowing my local copy away and starting all over again back with git part1 using my own name in the right places and that fixed it all.

I'm sure there is a fix for this but I couldn't work it out, it seems to link your local git copy of woof-CE with the git username pup-noob, not your online git username and this is the problem. Maybe karl or one of the git people can help.

peterw
Posts: 430
Joined: Wed 19 Jul 2006, 12:12
Location: UK

setting up git

#9 Post by peterw »

Hi scsijon

Thanks for the help. Deleting the puppylinux-woof-CE.d directory, using my own git name instead of pupnoob and starting again did the trick.
Another tip for anyone following this procedure is, "how to exit the git log screen". This produces long list of changes. Just type "q" and it quits allowing you to go on with the task.

peterw

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#10 Post by technosaurus »

Here is a trick that should be in every git toolbox:

Code: Select all

git clone --depth 1 <repository>
#or more detailed version
git clone --depth 1 --branch <branchname> git://github.com/<user>/<project>.git
clone a repository in its current state only (no history) useful if you want to make a patch, but don't want 2gb of history (linux repo for instance)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply