Questions tagged [git-workflow]

Git workflow is a guideline to branching and merging in git.

Git workflow is a guideline to branching and merging in git.

178 questions
1220
votes
10 answers

Create a branch in Git from another branch

I have two branches: master and dev I want to create a "feature branch" from the dev branch. Currently on the branch dev, I do: $ git checkout -b myfeature dev ... (some work) $ git commit -am "blablabla" $ git push origin myfeature But, after…
revohsalf
  • 12,265
  • 3
  • 13
  • 4
282
votes
4 answers

git + LaTeX workflow

I'm writing a very long document in LaTeX. I have my work computer and my laptop, and I work on them both. I need to keep all the files synchronized between the two computers, and also would like to keep a revision history. I chose git as my DVCS,…
Ivan
  • 16,448
  • 25
  • 85
  • 133
60
votes
7 answers

Git workflow without a server

Git is supposed to be a decentralized system, but all the tutorials and best practice workflows I have found on Google suggest using a server (usually GitHub, or else set up your own) I am using git for small personal projects (2-3 people), where…
Ben Page
  • 2,842
  • 4
  • 32
  • 36
57
votes
1 answer

Gitflow feature vs bugfix branch naming

While using Gitflow, what is the reason for separating branch naming to feature vs bugfix vs hotfix? I.e. why not just, for example, instead of: feature/ bugfix/ hotfix/ Just do: change/ What does separating by feature/bugfix/hotfix buy?
Pavel Chernikov
  • 1,889
  • 1
  • 15
  • 33
34
votes
4 answers

How do I reverse a specific hunk of a commit in git?

I'm wondering if there is a way to quickly reverse specific hunk of a commit. I can generate a diff between two commits or HEAD to see the difference. How do I reverse just one of those hunks (or better yet, a set of specific hunks)?
dkinzer
  • 28,835
  • 12
  • 63
  • 79
22
votes
2 answers

What are the pros and cons of using a trunk-based Vs feature-based workflow in Git?

I pretty much like the idea of the feature-based workflow in Git: using feature branches to support parallel development. In a feature-based workflow, I would develop my tasks in a feature branch (off master), and I would rebase often from master to…
letimome
  • 696
  • 1
  • 7
  • 20
19
votes
5 answers

Git workflow diagram creation is done through a graph/flowchart design tool?

When I look at most of the websites people demonstrate their git workflow in pictorial fashion. I would like to know which tool is used for the same ? For example https://wiki.phpbb.com/images/c/c8/Phpbb-git-workflow-small.png and…
holyAsh
  • 333
  • 1
  • 3
  • 10
17
votes
3 answers

setting up git repository on local machine

How can I setup a git repository on a local system ? (I am on a windoze box) This is the setup I am trying to achieve: (everything is on my local machine) host folder (which acts like central repository) client folder I want to do all my dev in…
brainydexter
  • 17,648
  • 25
  • 70
  • 108
15
votes
4 answers

Is it possible to tell Github that my branch was merged into upstream master?

I used my local branch feature to create a PR for a github repo (I don't have write access to it). Later I decided I want to separate its last commit into a standalone PR, so I moved feature one commit back: git checkout feature git branch…
max
  • 40,904
  • 40
  • 170
  • 328
8
votes
3 answers

Is a develop branch useless in git-flow?

Everywhere I look for the right way to use GIT in a team, we always get referred to git-flow. We started to use this scheme as our bible at the beginning: Time passed, and we finally found that keeping master as the stable branch with tagged…
Christophe Chenel
  • 1,401
  • 1
  • 10
  • 38
8
votes
7 answers

Disallow branching from and merge of specific branches

Is there a git hook or some other way to prohibit branching from and merging of specific branches. We want to make sure that we don't merge a "dirty" integration branch into our clean deployment branch. The major goal is that people cannot execute…
sdepold
  • 5,921
  • 2
  • 37
  • 45
7
votes
1 answer

Workflow strategies for mitigating merge conflicts from topic branches

I'm right on the cusp of selling git to my higher-ups. They're listening to us talk about it, anyway. There's one thing I'm unsure of, and I'd like to see how people deal with this. Basically my question comes from the fundamental understanding that…
Dan Ray
  • 21,345
  • 6
  • 61
  • 86
7
votes
1 answer

Using a master branch clone for public_html directory

We are using git installed on a web server to develop with and we have placed a bare .git project outside of the public_html directory, and then we're cloning the master branch to a directory inside public_html. This allows us to push to the master…
Matt Dunne
  • 140
  • 1
  • 7
7
votes
7 answers

Git workflow to audit commits without rewriting history

I am working with a developer that is new to git, and I would like to setup a git workflow that would let me auditing the commits made by this developer (and possibly reject them) without forcing him to rebase his work (which is error prone for new…
Fabien Quatravaux
  • 3,370
  • 2
  • 21
  • 29
6
votes
1 answer

git compare two branches which contains some common commit with different hash

Context : We are a team of programmer who work on a project with severals branches : Master, Release, Develop Sometimes we need to fix a bug on release, and we need to report this fix on develop, to report our bug fix we use : git cherry-pick…
1
2 3
11 12