Git is the central place of the project. Inside this repository we store all changes of the Source Code.
Before you are able to make your own changes to the source code you need to setup Git:
It is strongly recommended to use branches to keep a clean and stable master repository.
To get the latest changes type:
git pull origin master
This will download the latest changes from the IPFire server and apply them to the current(!) branch.
To get remote branches add them and use:
git fetch name
To list all available branches use:
git branch -a
To list all remote branches of a user type:
git remote show name
To create a new branch type:
git checkout -b branchname
It is also possible to create a local branch and track them to an other or remote branch type:
git checkout -b branchname -t name/branch
To switch between branches type:
git checkout an-other-branch
To remove existing local branches type:
git branch -d branchname
To remove existing remote branches type:
git push username :branchname
To rename a branch use:
git branch mv old name new name
To merge branches together type:
git merge brachname
This will merge the content of the choosen branch into the current(!) branch.
To autoremove local branches if the remote ones has been deleted use:
git remote prune origin --dry-run
The add of "--dry-run" will show you the branches which will be deleted, if you don't use it git immediately will start to delete the branches.
Use git to add a new file:
git add path/to/file.nm
NOTE: It's also possible to add more files or folders at the same time.
To rename or move a file use:
git mv path/to/old/file.nm path/to/new/file.nm
git mv oldfile.nm newfile.nm
To delete a file type:
git del path/to/file.nm
To share your changes with the community or the developers you have to commit them. A commit is a permanent save of all changes. So the should be checked carefully.
Keep in mind to get the latest changes from upstream before commit anything.
To do this use:
git commit file/to/commit
git commit file/to/commit an/other/file
Use commit messages like: "pkg name: Summary of your changes."
If you have an development account you can push your commits to the git server. If you haven't an own account you have to create a patchfile.
To do this type:
git commit --amend
To do this type:
git format-patch origin master --stdout > patchfile.patch
To create a patchfile from a commit use:
git format-patch -1 <sha> - where <sha> is the id from the commit
It is recommended do check received patchfiles before applying them:
git apply --stat patchfile.patch # To show the header
git apply --check patchfile.patch # To check the patch
Finally assume the changes:
git apply patchfile.patch
To push your changes type:
git push name branch