0

Each time I come across something harder than pull and push with git, I end up fighting doing weird stuff that I could have done probably in one command if I was good at git.

This time I know for sure I am going to reuse the process a lot and I don't want to do it the wrong/long way. So I seek for a git expert to tell me how he would do that. Plus that look like something a lot of people must have wanted to do already.

I have a project on github, and I would like to organize it like that:

1: dev branch

The dev branch contains up to date code, and superfluous stuff used for continuous interrogation, benchmark creation folders, doc creation softwares...

2: master branch

The master would be a branch that reflects only version changes in the history (ie, each time I reach stable step on dev), without the superfluous files used in dev.

3: why

This organization allows master to be an the easy dowloadable point for every stable version of dev, with the addition of having a clear changelog, while the dev branch contains a regular low level technical changes commit history. I think it's really handy.

So I need a way to pull only some folders of the dev branch from master, but without leaving any trace in the history. Then I need to modify some files (version and readme), commit the result with a version changelog message as the message, and finally push to master.

What is the best way to do that according to people versatile in git?

Edit:

It would also resolve my problem if I could pull without pulling any unstaged file. This would allow me to configure as wanted master once and just pull with this option for every release.

Edit: Doing: git checkout dev -- LISTOFSTUFFIWANT work. But I dont find any way to ask git to "checkout everything from this branch except those 3 files"?

11
  • 1
    Does this answer your question? Applying the changes from branch b to a, without merging or adding commits Commented Jun 11, 2020 at 15:27
  • Or maybe stackoverflow.com/questions/449541/… Commented Jun 11, 2020 at 15:28
  • Or maybe stackoverflow.com/questions/10784523/… Commented Jun 11, 2020 at 15:30
  • When developing your workflow, I'd suggest reading up on established git workflows, if you haven't done this already. There are several in widespread use, meaning others have found them helpful. Once you read and understand them, you may want to use one, or still make up your own, with ideas gleaned from widely-used ones. Commented Jun 11, 2020 at 15:31
  • 1
    I'm also not sure why it bothers you to have all the files in the master branch. They are part of the project... Commented Jun 11, 2020 at 18:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.