Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8416769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:51:38+00:00 2026-06-10T01:51:38+00:00

I have a build system that takes a git repository, goes back to a

  • 0

I have a build system that takes a git repository, goes back to a specific commit, and then uploads those files some where. Then is goes back to master.

I’m unsure that I’m using the right Git commands, as Git will give me this message whenever I perform a git checkout SHA:

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

The only thing I want to do is to reset my working directory to a specific commit, upload those files, and go back to HEAD/master. I might make a few changes to files when I go to the specific commit SHA (convert XML to JSON or something), but I just want to loose all of those changes when I go back to master. Right now this is my code

git checkout SHA

# do a bunch of conversion and uploading

git checkout master

Is that the preferred way of doing what I want? Will I always be able to do pulls from the origin without getting any file conflicts (I don’t want to keep whatever I’m doing between the checkouts)?

I’m asking because I’m seeing “your master and origin/master diverged” some times, although I’m not sure it’s caused by this.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:51:40+00:00Added an answer on June 10, 2026 at 1:51 am

    It’s perfectly OK to do this. When HEAD isn’t corresponding to a branch name it will be shown as a detached HEAD. Nothing wrong with that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a system that takes information from an external source and then stores
I have a system that uses CVS. Build takes a long time, partially because
I have made a build system for my web application that's rewriting all resource
I'm developing a system, and I have build a code generator that emits a
I'm working on a menu system that takes a url and then queries the
Right now I have a Phing script that takes the files from a branch
I currently have built a system that checks user IP, browser, and a random-string
I have built a backend system that allows a user to add multiple content
I have an existing system built in Java we currently expand that by adding
We have a system build on lots of languages. The ones we are interested

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.