Questions about working with Git

There are many guides in Git, but I have not seen many that explain how developers actually use it on a daily basis. I understand the basics of push, pull, commit, etc., but I don’t understand when to use branches.

In local repo:

  • Should you create a new branch for each set of changes or work normally with the main branch?

  • Should you create a new clone for each branch?

  • When do you merge your local branches with the local master?

Thanks.

+3
source share
4 answers

Should you create a new branch for each set of changes or work normally with the main branch?

. , ( " " ), , . .

, , , . , "" , .

, , , .

?

. ? git checkout <branchname> .

: git stash, "" , .

?

"" , . .

( ) ?

, git pull, git push ref .git/config.

, .

+4

?

, , , , . , .

, , , , , , . , , , , .

, , ( ), . , , , .

?

, . "git stash", , , .

?

, , , , . .

( ) ?

, , . , , , . , , , .

, ?

. , , , . Git , , , , .

+3

?

, .

?

. .

?

, , , . , . (GitHub?)

0

, IDE, .

, - , .

One of the most common usage patterns is to use "function branches" where you create separate functions in separate branches. Then you can have one or more integration branches (= releases) that you combine these functions.

0
source

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


All Articles