-
-
Notifications
You must be signed in to change notification settings - Fork 1
How to make a merge request (pull request)
This is stub documentation, contributions are welcomed.
- Fork repository
- Clone your forked repository (git clone path/to/forked/repo)
- Make a new branch (git checkout -b name)
- Make your changes in the file
- Commit the changes (git commit -a)
- Push the changes (git push remote branch)
- Make a merge/pull request by natigating on your repository and pressing "Pull Request"
- You have to change directory to your git directory for it to accept git commands unless you are using
git worktree=path/to/git/dir commands
- git is using remotes to manipulate commits where
origin
is default remote - Changes on remotes are differenciated in branches where
master
is default branch
Forking is done on github gui
Which is going "copy" repository in your profile or target organization.
Once you forked repository to which you want to contribute you need to clone it to have write access and stage changes.
# 'Download' repository in your system
git clone url path/to/dir
We recommend using /usr/src/name
which is respecting FHS 3.0 (https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s12.html)
Alternatively you can make a new directory in path/to/dir
and invoke git init
which is going to convert said directory into a git directory, add a new remote by invoking git remote add origin url
and pulling from said remote by invoking git pull origin master
(Origin is default remote set by git)
Remotes are remote repositories from which git is able to fetch commits
sidenote: You may need to invoke git fetch
to fetch all references
To differenciate the changes from your master (main branch by default) we require that you make a new branch tracking changes from master
# Make a new branch tracking from current branch
git checkout -b name
You can now make your changes to the forked repository which are going to be tracked by git later
Git is using commits to index the file changes
# Commit your changes
git commit -a
# Commit without openning the text editor (not recommended unless you know what are you doing)
git commit -m 'msg'
Note that if you created a new file you may need to invoke git add path/to/new/file/in/git/dir
for git to track it.
Please review the changes that you are making in the commit
For changes to be available on your remote repository like github you need to push them.
# Push changes on remote repository
git push remote branch
Where remote is by default origin
and branch is your branch that you just created.
(or as github calls it pull request which is just wrong)
Open up gitub and use a GUI to make a merge request:
Make sure that you are merging from correct repository and branch to correct repository and branch.
Please review commits before merging we are ideally expecting one commit per change
Ideally make a description that is sensible to others to know what are you changing and why