2

My requirement is to do daily checking into local repositories and push them to central repository to avoid code loss due to local system failure.

However, I cannot push the code to the actual development branch on origin and need a solution where those changes are present on central but not on the main branch.

I have already thought about using a separate branch for such changes.

Is there any other solution (something similar to shelve set in TFS)?

jub0bs
  • 60,866
  • 25
  • 183
  • 186
jazz199
  • 911
  • 1
  • 8
  • 12

2 Answers2

1

The equivalent to a shelveset in git is a branch. Branches are cheap in git, so just create your branch off the development branch and push that to the server.

Terje Sandstrøm
  • 1,979
  • 15
  • 14
1

The Git workflow you are describing, and which is very common, is one where you have a local and remote feature branch. Every day, you would do your work and make commits in the local branch. At the end of the day, you would push your local branch to the repository. When it comes time to bring your changes into the main branch, you can do a merge or a rebase.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360