Skip to content
Snippets Groups Projects
Commit 7d77296e authored by Sivecano's avatar Sivecano
Browse files

some updates

parent 110a2392
No related branches found
No related tags found
No related merge requests found
...@@ -285,18 +285,126 @@ but also set it up for use ...@@ -285,18 +285,126 @@ but also set it up for use
Under the Gitlab homepage find the `New Project` option Under the Gitlab homepage find the `New Project` option
### Add a README ### Add a README
A README file contains some explanation about your project. Like some sort of small landing page. A README file contains some explanation about your project. Similar to a small landing page.
A README can be invaluable for both others and your future self. A README can be invaluable for both others and your future self.
A README should generally support
* A description
* Setup instructions
* Usage instructions
* Contribution Guidelines
* Acknowledgements
### choosing a License ### choosing a License
You own whatever you write. Adding a License allows others to use your code. You own whatever you write. Adding a License allows others to use your code.
There are many commonly used Licenses usable as a template. There are many commonly used Licenses usable as a template.
# Troubleshooting # Troubleshooting
## Stash and Pop
git does not allow to checkout if it would overwrite local changes.
### solution:
git stash # save edits to a separate "stash"
git stash pop # restore the changes from the "stash"
## Amending commits
scenario: you've commited something you didn't want to or left out something. You haven't pushed yet
git commit --amend
allows you to add the current staging not as a separate commit but as part of the previous commit.
## Merge conflicts ## Merge conflicts
* Remember from earlier:
1. Keep Calm
2. use `git status`
3. follow the instructions
git adds conflict-resolution markers
<<<<<<< master
...
=======
...
>>>>>>> branch
resolve these either manually or with `git mergetool`. mark as resolved with `git add`
# Best Practices # Best Practices
## Commit Frequency
Commit often but not too often.
Commits should represent reasonable checkpoints in the history of the project.
## Commit messages
Commit messages should be short and descriptive.
## Bad Commit Messages
#### Too short / not descriptive
asdf
#### Too Long / not concise enough
Added Files concerning our upcoming migration from mySQL to mariaDB so we can manage our aggregated Datasets more efficiently..
#### Off topic
I had Pizza for lunch and it was amazing!
## Good Commit Messages
Add Abstract
\
Remove the old graph rendering code
\
fix various typos in the README
\
fixed issue #1
## Branches
Branches are a useful tool both for experimenting with rewrites and new feature or for developing a
different version of your project.
# Outlook # Outlook
## Where to Learn More
* look at git help pages
git --help # display help for git
git [command] --help # diplay help page for specific command
* https://git-scm.com/book/en/v2 (the Git Book)
* http://cs.stanford.edu/~blynn/gitmagic/ (full tutorial)
## Text Based Formats that work well with Git
* .tex (\LaTeX) for documents
* .md (Markdown) for notes
* .csv (Tables) for data
* .svg (Vector Graphics) for visualisation
* .html for web content
* Any Source Code files
## Git Hosting providers
* [Github.com](https://github.com) biggest platform. run by Microsoft.
* [codeberg.org](https://codeberg.org) non-commercial platform for open-source code
* [Gitlab.com](https://gitlab.com) open-source alternative for bigger projects and enterprise
## Useful Commands
Display a beautiful commit and branch graph
git log --decorate --graph -all
git log --decorate --graph --all --oneline
Selectively apply commits
git cherry-pick
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment