Git: Difference between revisions

m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:


See [[Git/hacks]] for example commands
See [[Git/hacks]] for example commands
{{Subpages|}}


== Intro to Git ==
== Intro to Git ==
Line 32: Line 34:
# store password in memory for an hour
# store password in memory for an hour
git config --global credential.helper 'cache --timeout=3600'
git config --global credential.helper 'cache --timeout=3600'
 
git config --global push.autoSetupRemote true


# recent packaged versions of git might be 1.8.3.1 (CentOS 7.4) whereas the current available is 2.15.1
# recent packaged versions of git might be 1.8.3.1 (CentOS 7.4) whereas the current available is 2.15.1
Line 103: Line 105:


== Decentralized Workflow and Branching Model ==
== Decentralized Workflow and Branching Model ==
Here's a good explanation on how most groups use Git in a successful branching model for development, "master", release branches, hotfixes, etc.
Now known as the "'''Git Flow'''" model. When using git for software development where you maintain long-running branches for various supported product versions and also work on the 'next' release in sprints or some development cadence, you need to use this model. '''Git Flow''' is a successful branching model for development, "main", release branches, hotfixes, etc. See https://nvie.com/posts/a-successful-git-branching-model/
http://nvie.com/posts/a-successful-git-branching-model/
 


In contrast, the 'GitHub Flow' model where you really only ever have one product that marches forward, the focus is on a simplified fork (branch) and Pull Request (PR) approach. This simplified model is more appropriate for simple products like documentation or a website.
== Submodules ==
== Submodules ==
Using multiple repositories to compose your project.  See https://git-scm.com/book/en/v2/Git-Tools-Submodules
Using multiple repositories to compose your project.  See https://git-scm.com/book/en/v2/Git-Tools-Submodules