Manual GitLab: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
Herre011 (talk | contribs)
Created page with "Manual GitLab: Create projects and add files ## This shows an example, step by step, to create a project and add files into that project. 1. Configuration: Create a folder i..."
 
Herre011 (talk | contribs)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Manual GitLab: Create projects and add files ##
Manual GitLab@WUR: Create projects and add files
This shows an example, step by step, to create a project and add files into that project.


1. Configuration:
== Signing up ==
If you haven't done so already, install git in your local machine and sign up at GitLab@WUR:
  https://git.wageningenur.nl


Create a folder in your machine:
== Example of local commands to execute ==
/home/juanma/Git_Stuff
<source lang='bash'>


configuration step 1: Copy into that folder the commands from the git-web: https://git.wageningenur.nl/  and then ABGC_Genomics/
## This shows an example, step by step, to create a project and add files into that project.


cd /home/juanma/Git_Stuff
## Configuration:
git config --global user.name "Herrero Medrano, Juan"
git config --global user.email "juan.herreromedrano@wur.nl"


configuration step 2:
# 1. Create a folder in your machine, e.g.:
mkdir ~/Git_Stuff


cd /home/juanma/Git_Stuff
# 2. configuration step 1:
ssh-keygen -t rsa
git config --global user.name "Herrero Medrano, Juan"
cd /home/juanma/.ssh/
git config --global user.email "juan.herreromedrano@wur.nl"
cat id_rsa.pub


Copy the code and go to the git-web: Profile settings -> SSH Keys. Paste the code and add key.  
# 3. configuration step 2: make private-public rsa key pair
configuration step 3: Go back to the terminal:
ssh-keygen -t rsa
cd ~/.ssh/
cat id_rsa.pub
# Copy the code and go to the git-web: Profile settings -> SSH Keys. Paste the code and add key.  
# IMPORTANT: make sure you use the *public* key, not the private part of the key pair!
# The configuration is finished.


git clone git@git.wageningenur.nl:ABGC_Genomics/Turkey_Association.git
## Create a project:


Once I have made this connection, my project will appear as a folder in /home/juanma/Git_Stuff
# 1. Log in https://git.wageningenur.nl. Then create a project (name of the project should not have spaces or dash '-'). In the example, the project is called Turkey_Association
# 2. Go back to the terminal:
cd ~/Git_Stuff
git clone git@git.wageningenur.nl:ABGC_Genomics/Turkey_Association.git


# Once I have made this connection, my project will appear as a folder in ~/Git_Stuff


2. Add files:
 
Add scripts to the project "Turkey_Association" :
## Add files:
cd /home/juanma/Git_Stuff/Turkey_Association
# Add scripts to the project "Turkey_Association" :
cp myscript.sh /home/juanma/Git_Stuff/Turkey_Association
cp myscript.sh ~/Git_Stuff/Turkey_Association
git add myscript.sh
cd ~/Git_Stuff/Turkey_Association
git commit -m "myfirst_commit"
git add myscript.sh
git push origin master
git commit -m "myfirst_commit"
git push origin master
 
 
## Remove a directory:
git rm -r one-of-the-directories
git commit -m "Remove duplicated directory"
git push origin master
 
</source>
 
== See also ==
[[Bioinformatics_protocols_ABG_Chairgroup | Bioinformatics tips, tricks, workflows at ABGC]]
 
== External links ==
*[http://en.wikipedia.org/wiki/Git_(software) Wikipedia entry on Git]
*[https://github.com GitHub, a public Git repository (not to be confused with GitLab@WUR, but uses the same Git versioning software)]

Latest revision as of 15:01, 9 April 2015

Manual GitLab@WUR: Create projects and add files

Signing up

If you haven't done so already, install git in your local machine and sign up at GitLab@WUR:

 https://git.wageningenur.nl

Example of local commands to execute

## This shows an example, step by step, to create a project and add files into that project.

## Configuration:

# 1. Create a folder in your machine, e.g.:
mkdir ~/Git_Stuff

# 2. configuration step 1: 
git config --global user.name "Herrero Medrano, Juan"
git config --global user.email "juan.herreromedrano@wur.nl"

# 3. configuration step 2: make private-public rsa key pair
ssh-keygen -t rsa
cd ~/.ssh/
cat id_rsa.pub
# Copy the code and go to the git-web: Profile settings -> SSH Keys. Paste the code and add key. 
# IMPORTANT: make sure you use the *public* key, not the private part of the key pair!
# The configuration is finished. 

## Create a project:

# 1. Log in https://git.wageningenur.nl. Then create a project (name of the project should not have spaces or dash '-'). In the example, the project is called Turkey_Association
# 2. Go back to the terminal:
cd ~/Git_Stuff
git clone git@git.wageningenur.nl:ABGC_Genomics/Turkey_Association.git

# Once I have made this connection, my project will appear as a folder in ~/Git_Stuff


## Add files:
# Add scripts to the project "Turkey_Association" :
cp myscript.sh ~/Git_Stuff/Turkey_Association
cd ~/Git_Stuff/Turkey_Association
git add myscript.sh
git commit -m "myfirst_commit"
git push origin master


## Remove a directory:
git rm -r one-of-the-directories
git commit -m "Remove duplicated directory"
git push origin master

See also

Bioinformatics tips, tricks, workflows at ABGC

External links