Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [git]

Git is an open-source DVCS (Distributed Version Control System)

-3
votes
2answers
122 views

Git Branching Convention : Baseline from Dev or Master

When creating a new feature branch should i baseline from Master branch or Dev branch and why? I am used to creating a branch from master as the baseline, making my changes and merging it back into ...
-3
votes
0answers
46 views

Use tags or branches for CI release builds? Or both? [duplicate]

Currently we use a branch "stable" from which our CI takes (by default) the last commit when building a new release. However I also keep seeing people suggest using tags for this, and just use "...
0
votes
1answer
133 views

Any advice for Git workflow using branch per development team (and not per feature)

In our project, we have 5 teams working on a monolithic application in 3-week sprints. Until now, all commits go into master (via Gerrit). Our test pipeline is too lengthy to ensure quality pre-commit,...
1
vote
1answer
112 views

How can I sync a git repository with directories from another machine?

My team and I use a git repository to keep track of our projects. This repository is cloned in our Windows PCs that we use to develop most of our software. However, we also use another machine ( a ...
-3
votes
1answer
69 views

How does branching and testing interact with a Git repo? Or can I simply create a Git branch in order to test new code? [on hold]

I've been using SVN on my current project and recently switched to Git. I'm not sure if this is the best place to ask beginner and/or conceptual questions about Git so I apologize if not. I think I ...
4
votes
3answers
159 views
+50

What's the best approach when you need to work off two branches that still have pending PR requests?

Let's say I have branch-1 (branched off master (major update)) and branch-2 (also branched off master (minor update)). What is the best approach to do when I need to create another branch, e.g. ...
49
votes
8answers
8k views

Should generated documentation be stored in a Git repository?

When you use tools like jsdocs, it generates static HTML files and its styles in your codebase based on the comments in your code. Should these files be checked into the Git repository or should they ...
-3
votes
1answer
114 views

Designing a mentoring system over GitHub

I am developing a system that has a list of projects (verified by mentors) to which a student can provide a solution. Now I am stuck in a situation about how the student will submit their solution for ...
-2
votes
2answers
128 views

Pushing commit (even in a dirty state) daily to remote git repository without polluting it with many work in progress commits

Context We have a team of one active developer and two occasional ones. We are setting up a new project and after reading https://nvie.com/posts/a-successful-git-branching-model I was seduced by the ...
0
votes
2answers
140 views

Need a Git branching how-to

Using GitFlow, I created a new class on the develop branch and gave it a property: Public Class Class1 Public Property Property1 As String End Class I committed that change and created a new ...
1
vote
1answer
60 views

NuGet versioning with gitflow

Some background information to our actual situation. We are migrating from TFS VC to git. We've a ASP .NET Web API with many different Controller Libraries (>30 assemblies). Many of them are ...
0
votes
1answer
82 views

Git strategy to use when a file I am going to edit in another branch has been updated in the master branch?

There are 3 branches involved in this question. I have the master branch, I have a bug-fix branch, and I have a refactor branch. This is the timeline: Created bug-fix branch off master to fix a bug. ...
-2
votes
1answer
135 views

Unit tests branch best practices [closed]

I'd like advice about on the best practice for Pull Requests organizing on middle size project. Especially relating to Unit Testing. Currently we create branch for each feature, what is practically ...
1
vote
1answer
69 views

Git structure for multi platform projects

Currently I use SVN for my project and the structure looks like this: trunk/SharedLibrary/ trunk/platform/wordpress/ <- platform base directory trunk/platform/wordpress/SharedLibrary <- ...
2
votes
1answer
47 views

Is infrequent syncing in DVCS trunk based development similar to a long-lived feature branch in GitFlow?

I'm working on a project and trying to understand the differences and trade-offs between variations of trunk based development and feature branching like git flow so I can help implement an ...
2
votes
2answers
105 views

How to approach long-lived feature code reviews in trunk based development?

My understanding is that trunk based development should rely on direct commits to master or short-lived feature branches that are merged with master. Incomplete work can be placed inside functions ...
0
votes
0answers
19 views

AWS codepipeline deployment

I currently have an AWS Codepipeline that is setup to automatically pull an Express, NodeJS API and deploy it with Lambda and API Gateway. It pulls the code from my GitHub repo production branch and ...
0
votes
1answer
30 views

Removing unused directives from a file which is not related to the pull request [duplicate]

I'm actually working on the web application which was made using technologies such as asp.net core, c#, angular, ef core. For the version control and CD we use Azure DevOps. As a team we try to follow ...
0
votes
1answer
57 views

How to organize work with a few projects with shared codebase?

We develop two projects (and more in future) with JS, Vue.js, using npm, and we store each project in its own git-repository. We want to place common components (buttons, page-parts and page ...
0
votes
1answer
51 views

How to have SQL Server with Git, TeamCity and Octopus auto-deployment work with schema-level restrictions?

We are starting to integrate our SQL Server workflow with Git, by which I mean generating scripts for all objects and storing them in a Git repository so you can pull, edit, commit, push and apply, ...
0
votes
3answers
171 views

Git Flow, pull requests, multi-destination branches and conflicts: how is it supposed to work?

I get it for feature branches: A feature branch is created from develop. One single PR is then created, going to develop. If there are conflicts, fix them in the feature branch. Quite ...
-2
votes
1answer
85 views

Managing release branches in Git

When learning Git for the first time, I posted Git branching and tagging best practices. I learned a lot from this and have adapted git flow patterns to my personal projects since then. I am now in ...
2
votes
3answers
274 views

How to manage a global source code style change?

We have a large Git repo. The files are a mix of styles: tabs vs spaces, unix vs windows line ending, JSON formatting styles, etc. We'd like to change every file to be consistent. However, if I ...
2
votes
0answers
110 views

Handling multiple pull requests from a branch

Our current workflow is that we create a Sprint branch and then developers create Feature branches having the user story number. Once the story is complete this Feature branch is merged to Sprint ...
1
vote
0answers
36 views

Wordpress and git, (using WPE), how do you incorporate database changes into the workflow?

We use WordPressEngine and want to have multiple developers and multiple branches using git. One challenge is how do we incorporate the database into the workflow? Should we take a sql dump and ...
2
votes
4answers
213 views

Managing QA testing when there's pressure to merge things at the earliest possible

I'm working in a team of 12 where we have around 8 developers and a QA. We do not follow a git flow model but we do have feature branches where individual feature developments take place and then ...
1
vote
1answer
102 views

How do you manage development-only files in your source control? [duplicate]

When merging development code into the production code, what is the preferred method for handling items that should not be in the production code branch? For example, I have configuration scripts that ...
2
votes
3answers
167 views

Git project organization

My company currently has SVN as main version control and we are in process of migrating to Git. Doing that is a perfect chance to do a structure reorganization. Before I get to that let me describe ...
41
votes
6answers
6k views

What's the best way to handle refactoring a big file?

I'm currently working on a bigger project which unfortunately has some files where software quality guidelines where not always followed. This includes big files (read 2000-4000 lines) which clearly ...
0
votes
0answers
80 views

Git feature branch workflow for multiple branched features

I wanted to summarize a quick discussion we had in my stand-up today. We have a big feature branch merge coming up in our system. We are replacing the old live, system (branch master) with a redesign (...
4
votes
5answers
219 views

Git branches: Merging issues while having multiple release branches

We have to support multiple releases, so we are following git branching model similar to the above diagram. Now the problem is that we have to do lots of merging here example for fix/011, we are ...
3
votes
5answers
384 views

Versioning: Where exactly in the code or repository should I write the version number?

Right now I'm doing this: Update the readme to include the new version number and what it does. Commit the version number in git commit message (i.e git commit -m "1.2.1: this does that"). Push the ...
1
vote
4answers
250 views

Git Flow: should develop branch be unit tested in CI?

We have a Git Flow type workflow (in rails) where our 'testing' (aka develop) branch has feature branches merged into it for UAT. So: master has the current running production system. feature ...
-1
votes
1answer
42 views

Branching strategy when utilizing open source application

I'm looking for advice on what a good branching strategy looks like when using mostly open source code. Most of my dev experience is with writing and working with custom made code and only using open ...
30
votes
4answers
4k views

When should a commit not be version tagged?

Context: I recently found out about Semantic Versioning, and am trying to determine how to best use it practically for my own projects. Given that semver takes major changes, minor changes, and ...
1
vote
2answers
83 views

Refactoring large comment blocks

I am working in a fairly old code base. In the code base they have the classic source control, gigantic code blocks at the top of the files and above the function definitions that have something like ...
1
vote
0answers
34 views

What impact does the ancestor file have with git merge-file?

Consider this example command line session... $ git --version git version 2.19.0.windows.1 $ echo "header" > ancestor.txt $ cp ancestor.txt left.txt $ cp ancestor.txt right.txt At this point, ...
1
vote
2answers
153 views

Applying hotfix to intermediate commit on master

Below is the Gitflow workflow followed, where master branch has the commit history(git tag) of different releases. From release mgmt aspect, we are deleting the release branch after merging with ...
-2
votes
1answer
92 views

Release pipeline - Which artifact goes in production?

Below is the GitFlow workflow, we are using for a project. So, in our project master branch currently has only one git commit with just a Readme file. develop branch is forked from that commit. As of ...
1
vote
2answers
155 views

Reducing dependencies between stories & which branch (GIT) should QA's test on?

Background We have a team of 8 devs and 1 QA (tester) and we're struggling with dependencies between tickets and causing a lot of merge headaches and/or people waiting around for the next bit of work ...
0
votes
0answers
27 views

Code base architecture for one app that has multiple versions with small changes [duplicate]

I'm building a hybrid mobile app that has slightly different versions but share 99.9% of the code. There is a paid and free version, which differ in one function only. Also there is a slight ...
2
votes
0answers
57 views

Can/Should I make an automatic installation of new python libraries after a git pull?

Imagine the following situation: I'm working on a python project, and I install the library antigravity with pip. I add the function fly() which uses the library, and I commit and push the changes. ...
4
votes
2answers
190 views

How do I merge branches between Develop - Test and Production without moving across 'test' specific code?

I have a web application that has some specific differences between production and test environments. I.e. test email config, test payment config, the word Test written on the home page (useful to be ...
1
vote
3answers
81 views

Do I need to 'deploy' my web project when I can just keep a recent clone of the Master-branch in public_html?

We have git installed on our webserver (via cpanel), but unfortunately no CI- / Deployment-Tools. Would it be good practice just initialise our repository in /public_html/ and push our local Dev-...
1
vote
1answer
118 views

Storing test results in a Git repo?

At my company, we use a distributed pool of virtual machines to run our UI and API tests. These machines are all connected to an onsite server which the pool uses for publishing the test results and ...
1
vote
2answers
96 views

How to deal with multiple features in a single git repository in QA

So I'm running into an issue with us trying to test multiple features in our QA environment at the same time. Essentially, changes are taking too long to get promoted in our CI/CD pipeline. The way ...
1
vote
0answers
172 views

Multi module Maven project or separate repositories?

Consider the following architecture: Application A Application B Commons-Util A and B share a lot of functionality. That's why we plan to extract the shared code into a commons library. I am aware ...
2
votes
1answer
127 views

Sharing a sub-project and some users are git beginners?

We have two teams, each using git, and would like to share a small project between them. Git submodules sounded like an obvious answer until I started searching and found lots of "submodules will ...
0
votes
1answer
100 views

Effective GIT Branching Strategy

I am trying to figure out the optimal branching strategy for my organization. And I have few doubts. We have 3 main environments, Live(Production), UAT (pre-release) and Staging. Similary in GIT we ...
-2
votes
1answer
47 views

Fork 3 repo's into 1 main one

I have a specific problem in git which I havent found an answer to yet. In gitlab I have 3 seperate repos. For my school project the teacher wants me to copy everything into a repo of his and wants to ...