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

  • Home
  • SEARCH
  • 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 739345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:23:23+00:00 2026-05-14T08:23:23+00:00

Possible Duplicate: git push error '[remote rejected] master -> master (branch is currently checked

  • 0

Possible Duplicate:
git push error '[remote rejected] master -> master (branch is currently checked out)'

I am new to Git and trying to use it for a local grails project.
The steps I followed:

  1. create the grails project
  2. go to the project directory and git init
  3. Add all the files in the project in staging area and commit.
  4. The git status at the repo gives the below message

    BXX@BXX-PC /c/Work/Grails/projects/yyy/tables (master)
    $ git status
    # On branch master
    nothing to commit (working directory clean)
    
  5. Trying to keep it as the master branch, make the changes by cloning the repo, and later push the changes back. For that

  6. In my IDE, checkout the project (IntelliJ).This actually clone the project to another dir.
  7. Make the changes and commit the project
  8. Push the local changes to master.

    15:41:56.249: git push -v origin master
    Pushing to c:/Work/Grails/projects/xxx/tables
    remote: error: refusing to update checked out branch: refs/heads/master        
    remote: error: By default, updating the current branch in a non-bare repository        
    remote: error: is denied, because it will make the index and work tree inconsistent        
    remote: error: with what you pushed, and will require 'git reset --hard' to match        
    remote: error: the work tree to HEAD. 
    

The cloned repo status is

$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

Please help me with understanding this. Is there a better workflow to follow. I may be able to initialize the repo through Intellij, and try to work on the main branch. Still not sure what is wrong above.

thank you.

  • 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-05-14T08:23:24+00:00Added an answer on May 14, 2026 at 8:23 am

    First of all, you do not need to clone your local repository. You can use branches to divide development in the same repository.

    Git is a Distributed VCS, and if you have experience with Subversion or CVS before it, you need to change your mind.

    Git is a very agile and you can use different workflows with it. Cloning repositories is more needed for a team work, not for local development (IMHO).

    Branches is a good alternative for you.

    See. Let’s set master branch of your repository for a production-ready code. Let’s create another branch for development:

    $ git checkout -b development master
    

    Now you are working on the development branch.

    You could use different branches for each feature you want to develop. It’s very easy and helpful.

    Let’s imagine you want to implement some new feature, you need to create a new branch:

    $ git checkout -b newfeature development
    

    Now you can work with your code, add files, commit and so on.

    Next you need to merge your new developed feature to the development branch:

    $ git add .
    $ git commit -m "My last changes for the new feature"
    $ git checkout development
    $ git merge newfeature
    

    Now your new code from the newfeature branch merged into the development branch.

    For sometime in the future when you decide that your code in the development branch get some milestone, you could merge all the changes from development to master branch.

    It’s a very basic workflow, it can be helpful for the many branches.

    My advise for you now: read more about git, branching, stashing (very-very-very helpful for quick fixes). And after some time you will get a great effort from using git.

    Good luck.

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

Sidebar

Ask A Question

Stats

  • Questions 357k
  • Answers 357k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.