Using git correctly

I read and tried Git over the past few days, and I have one more thing that I can not find good information on.

I read that using Git, an open and closed repository is usually created on each developer's machine in such a way that the developer can make private commits as many times as he wants, and then just click on the public repository as soon as they are satisfied with the changes.

I would like to know two things:

1 - how to configure such a system as above (when using the approach with a centralized type (repository created using -bare).

2-I want to be able to make as many commits for my personal repository as I want with any commit message, and not show these messages (or revisions) when I push my changes to a public repository or to an open repository). I.e. I want my public changes to be recorded as a one-time amount with one message.

Thank!

+3
source share
3 answers

Git, FAQ, git -demon, HTTP SSH- ( Linux, , unix ). , , GitHub.

, "" git merge git rebase -i (). git rebase -i. ( ) . - :

pick 0000001 Fixed big bug 1
pick a000002 Fixed big bug 2
pick dae3124 Fixed big bug 3
pick 3554abc Fixed big bug 4

# Rebase 5cea2cd..8963229 onto 5cea2cd
#
# Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the commit message
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#  f, fixup = like "squash", but discard this commit log message
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#

, - :

pick 0000001 Fixed big bug 1
squash a000002 Fixed big bug 2
squash dae3124 Fixed big bug 3
pick 3554abc Fixed big bug 4

, Git , . , 0000001, a000002 dae3124 " 1, 2 3." . ( fixup .) :

0014234 Fixed big bugs 1, 2 and 3.
3554abc Fixed big bug 4

(, hash , , .)

, .

+1

,

I recommend reading this free book on git. ProGit book . This gives very good grounding in all git functions.

To solve your immediate problem, I will direct you to this page

http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository

I use this process in work. Great workflow. I recommend it.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1753610/


All Articles