pushing to cloned repo with SourceTree

I am part of a team that is new to git and distributed version control and I am getting very frustrated...

We are using SourceTree.  We created a new repo with SourceTree on our shared development server.  We commited all of our existing files and then deleted all of the old Archived code and committed again.  We can still see the old code but it's cleaned up. Life is good...

Each person then used SourceTree to clone the repo on their local machine.  They now have all of the files, can make changes locally, stage them and commit them.  Everything is great until we try to push changes back to the main repo that we cloned from.  We get an error that we can't push to a non-bare repo. 

So based on that error message and some googling, I changed receive.denyCurrentBranch  to ignore in config of the repo we all cloned from.  Now we can push to it, but, OOPS, now the main repo shows our changes in SourceTree, but the actual files didn't change.  (and the main repo on our shared development server is now seeing all the file changes we made locally but weren't actually applied to the shared server as changes that need to be staged and committed now.)

It seems like this should all be so simple;  I know thousands of people successfully use this everyday... what are we missing?!!

 

2 answers

See if this explanation of a bare repository helps: http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/

Why not convert your reference repository on development server to a bare repository? It's straightforward:

  • Make a (new) clone of your reference repository to your local machine
  • Delete the reference repository on the development server
  • Create a new BARE repository on your development server (using the name of your repository)
  • Push the previously cloned repository from your local machine to the new, bare repository on your development server
  • After this anybody should be able to push to this new repository ...

 

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

790 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you