-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitpull.txt
69 lines (49 loc) · 2.79 KB
/
gitpull.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#----------------------------------------------------------------
# Commands to initiate a pull request for another's code on Git
#----------------------------------------------------------------
# Load Git on Unix terminal
> module load git
> git
# Change into working directory
> cd 01_Code/Git/
# Ask for help on commands such as 'add' and 'push'
> git add -help
> git push -help
# Copy code from your online repository to local Unix repository
> git clone https://github.com/emm13/deconstructSigs.git
# Make modifications to your script and save it
# I added the parameter 'bsg' to 'mut.to.sigs.input.R'
> nano mut.to.sigs.input.R
# Add your modified code to the local repository
> git add mut.to.sigs.input.R
# Check the status of your repository now that a file has been modified
> git status
# Commit your changes to your local repository with an explanation of the change
> git commit mut.to.sigs.input.R -m "Adding parameter 'bsg' to make code accessible to earlier genome builds such as hg18"
# Get a shorthand link to your online repository using 'remote'
# Remote gives you the online location as well as acronym you can use to make life easier.
> git remote -v
# Output from remote looks like this
# _origin_ is the acronym in the example below and 'https://github.com/emm13/deconstructSigs.git' is the link is to my online repository
# You can use the acronym 'origin' for both fetch and push commands
# origin https://github.com/emm13/01_GitPull.git (fetch)
# origin https://github.com/emm13/01_GitPull.git (push)
# You can also create a shorthand for another person's repository if you are intending to submit your pull request to the directly from Unix
# rather than from your online repository
> git remote add decons https://github.com/raerose01/deconstructSigs
# When you rerun 'remote', here's what you get - all the links you might want to use to push/pull/fetch
# 'decons' is the other person's repository and 'origin' is mine
# > git remote -v
# decons https://github.com/raerose01/deconstructSigs (fetch)
# decons https://github.com/raerose01/deconstructSigs (push)
# origin https://github.com/emm13/01_GitPull.git (fetch)
# origin https://github.com/emm13/01_GitPull.git (push)
# Sync your changes to your online repository and
# 1. Initiate a pull request online
# 2. Initiate a pull request directly from Unix
# Push your local changes onto your online repository
> git push
# 1. Online pull request
# The rest of the steps, 15-20 are available at https://github.com/emm13/01_GitPull/blob/master/README.md
# 2. Local pull request
> git request-pull master https://github.com/emm13/01_GitPull