DeskTux

Linux on Desktops

User Tools

Site Tools


apps:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
apps:git [2019-09-02 14:23] – [Troubleshooting/Q&A] adding Q&A/troubleshooting steps jensapps:git [2020-07-24 09:34] (current) – [Troubleshooting/Q&A] Add ZSH link jens
Line 10: Line 10:
   - Change to that directory and initialize your git repository: <code>cd /srv/git/puppet.git; git init</code>   - Change to that directory and initialize your git repository: <code>cd /srv/git/puppet.git; git init</code>
   - Give your project a meaningful description:((Use your preferred editor, I just like vi)) <code>vi .git/description</code>   - Give your project a meaningful description:((Use your preferred editor, I just like vi)) <code>vi .git/description</code>
-  - Configure the basics of the git client: <code>git config --global user.name "Your Name"git config --global user.email your@email.tld</code>+  - Configure the basics of the git client:<code> 
 +git config --global user.name "Your Name" 
 +git config --global user.email you@example.com 
 +git config --global credential.helper store 
 +git config --global push.default simple 
 +git config --global color.ui true</code>
   - Create a README and make the initial commit: <code>touch README.md; git add .; git commit -m "Initialize Repository"</code>   - Create a README and make the initial commit: <code>touch README.md; git add .; git commit -m "Initialize Repository"</code>
  
Line 44: Line 49:
  
 ===== Troubleshooting/Q&A ===== ===== Troubleshooting/Q&A =====
-  * If you ever wonder what branch you are on, you can just run a ''git status'' to check that.+  * If you ever wonder what branch you are on, you can just run a ''git status'' to check that, or just use my [[:apps:zsh|ZSH]] configuration which will show the current branch.
   * If you use this for [[:apps:puppet|Puppet]] code, you could just create a symlink from the Puppet code directory to your git project:((Providing you used the same structure as mandatory in the [[:apps:puppet#manifests|Puppet]] code directory. Don't forget to backup first!)) <code>ln -sf /srv/git/puppet.git /etc/puppet/code</code>   * If you use this for [[:apps:puppet|Puppet]] code, you could just create a symlink from the Puppet code directory to your git project:((Providing you used the same structure as mandatory in the [[:apps:puppet#manifests|Puppet]] code directory. Don't forget to backup first!)) <code>ln -sf /srv/git/puppet.git /etc/puppet/code</code>
-  * In case you forgot to delete your branch on the server, or want to just delete it remotely, you can do that: <code>git push - u origin mybranch --delete</code>+  * In case you forgot to delete your branch on the server, or want to just delete it remotely, you can do that: <code>git push -u origin mybranch --delete</code>
   * If you already started editing but forgot to switch to a new development branch, in many cases it is still possible to just switch to a new branch after you made changes already and just follow the workflow.   * If you already started editing but forgot to switch to a new development branch, in many cases it is still possible to just switch to a new branch after you made changes already and just follow the workflow.
   * In case the local (master) branch is no longer usable, use these steps to reset it: <code>   * In case the local (master) branch is no longer usable, use these steps to reset it: <code>
Line 55: Line 60:
 Actually, stuff like parsing & linting, merging on the server and deploying your code where it belongs (e.g. Puppet) should be automated. A basic git setup like this doesn't allow for this, unless you throw some serious scripting at it. If you want pipelines and e.g. [[https://jenkins.io/|Jenkins]], you need tools like [[https://github.com/|GitHub]]. Actually, stuff like parsing & linting, merging on the server and deploying your code where it belongs (e.g. Puppet) should be automated. A basic git setup like this doesn't allow for this, unless you throw some serious scripting at it. If you want pipelines and e.g. [[https://jenkins.io/|Jenkins]], you need tools like [[https://github.com/|GitHub]].
  
-Unfortunately, they do not offer an open-source version of their software, just hosted by them or in an Enterprise Edition. Luckily, there is [[https://about.gitlab.com/|GitLab]] that provides all of this functionality. And: it will run on Debian :-) So if you want or need pipelines and Jenkins and user/privilege management etc, you should check out GitLab.+Unfortunately, they do not offer an open-source version of their software, just hosted by them or in an Enterprise Edition. Luckily, there is [[https://about.gitlab.com/|GitLab]] that provides all of this functionality. And: it will run on Debian :-) So if you want or need pipelines and user/privilege management etc, you should check out GitLab.
apps/git.1567427007.txt.gz · Last modified: 2019-09-02 14:23 by jens