Difference: GitRepo (1 vs. 6)

Revision 62009-10-06 - patricka

Line: 1 to 1
 

Informal HEP Git Repository

This is a guide to use the informal git repository at HEP-GC

Added:
>
>

Git on fate-2

Creating a Shared Repository

To create a shared repository on fate-2, first log in as the git user with your ssh key, then create a directory and initialize a repository in it.

user@fate-2 $ ssh git@fate-2.phys.uvic.ca -p 2200
git@fate-2 $ mkdir newrepo.git
git@fate-2 $ cd newrepo.git
git@fate-2 $ git --bare init --shared
git@fate-2 $ exit

Now as your regular user, create a local copy of your repo and commit your first file:

user@fate-2 $ git clone ~git/newrepo.git
user@fate-2 $ cd newrepo
user@fate-2 $ echo This is my new git repo > README
user@fate-2 $ git add README
user@fate-2 $ git commit -m "This is my first commit"

Now we'll link our remote repository, and our local repository, then push our first commit to the master branch.

user@fate-2 $ git remote add origin ~git/newrepo.git
user@fate-2 $ git push origin master

Now we're done!

Typical workflow on fate-2

First, we clone our git repo

user@fate-2 $ git clone ~git/newrepo.git
user@fate-2 $ cd newrepo

Now we'll create a new file, and push it back to the main repo.

user@fate-2 $ echo lalalal this is a file > newfile
user@fate-2 $ ls
newfile README
user@fate-2 $ git add newfile
user@fate-2 $ git commit -m "Added a newfile"
user@fate-2 $ git push

Done.

 

Github

Github is a free git hosting service, used by Nimbus, Rails and others. We use it too.

Revision 52009-10-02 - patricka

Line: 1 to 1
 

Informal HEP Git Repository

This is a guide to use the informal git repository at HEP-GC

Added:
>
>

Github

Github is a free git hosting service, used by Nimbus, Rails and others. We use it too.

Sign up for an account at github, and check out the repository at http://github.com/oldpatricka/HEP-GC-CANFAR .

Cloning the repository

If you're a contributor, try this out:

$ git clone git@github.com:oldpatricka/HEP-GC-CANFAR.git

If not, this:

$ git://github.com/oldpatricka/HEP-GC-CANFAR.git
 

Checking out a remote branch, and merging it with a local branch

Revision 42009-09-08 - patricka

Line: 1 to 1
 

Informal HEP Git Repository

This is a guide to use the informal git repository at HEP-GC

Line: 33 to 33
  merge = refs/heads/master
Added:
>
>

Checking out a remote branch, and merging it with a local branch

$ git branch newstuff origin/newstuff
$ git checkout newstuff

Great this new stuff looks pretty interesting, let's merge it back to the local master branch:

$ git checkout master
$ git merge newstuff

Let's push it back to the repo

$ git push origin master

But say we want to push to a different remote branch? First, checkout the remote branch as local, merge the two, push back:

$ git branch dev origin/dev
$ git checkout dev
$ git merge newstuff
$ git push origin dev
 

-- PatrickArmstrong - 2009-08-06

Revision 32009-08-13 - patricka

Line: 1 to 1
 

Informal HEP Git Repository

This is a guide to use the informal git repository at HEP-GC

Line: 11 to 11
 

Cloning the repository

Changed:
<
<
git clone git+ssh://fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR.git/
>
>
git clone git+ssh://git@fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR.git/
 

Switching to the repository

Line: 26 to 26
  logallrefupdates = true ignorecase = true [remote "origin"]
Changed:
<
<
url = git+ssh://fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR
>
>
url = git+ssh://git@fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR
  fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin

Revision 22009-08-07 - patricka

Line: 1 to 1
 

Informal HEP Git Repository

This is a guide to use the informal git repository at HEP-GC

Line: 11 to 11
 

Cloning the repository

Changed:
<
<
git clone git+ssh://fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR/
>
>
git clone git+ssh://fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR.git/
 

Switching to the repository

Line: 26 to 26
  logallrefupdates = true ignorecase = true [remote "origin"]
Changed:
<
<
url = git+ssh://patricka@fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR/
>
>
url = git+ssh://fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR
  fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin

Revision 12009-08-06 - patricka

Line: 1 to 1
Added:
>
>

Informal HEP Git Repository

This is a guide to use the informal git repository at HEP-GC

Web View

To view commits on the web, check out https://particle.phys.uvic.ca/~git/

It will show you all of the recent commits to the repository

Cloning the repository

git clone git+ssh://fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR/

Switching to the repository

To do this, you'll need to modify your origin. Edit $REPODIR/.git/config to look like this:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = git+ssh://patricka@fate-2.phys.uvic.ca/hepuser/git/dev/HEP-GC-CANFAR/
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

-- PatrickArmstrong - 2009-08-06

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback