Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pushing fails - Empty repository at remote server with GitKraken

I have found Gitkraken a few days ago and was playing with it a bit. I came to a point where I did not found any useful informations on the internet or the gitkraken faq about my question anymore.

I have the following case:

  • Local repository with 2 branches develop & master
  • Gitlab server where my repositorys are hosted
  • Clean repository created and added as remote
  • Tried to push but im sticking at the point when it want to know the remote branch but there isn’t a branch

I made some commits and wanted to push my commits to a brand new fresh empty repository but it always ask for a remote branch. So how can I push my existing commits to a remote when there exist no remote branch until yet?

enter image description here

like image 360
Hidden Avatar asked May 10 '16 09:05

Hidden


People also ask

How do I push my remote repository code?

To push the new commit onto the remote, you need to click on the push button again. Then, click push once more. That's it. Once the commit is pushed to the remote branch, you can see that the origin/master tag gets moved to the same commit as the master tag.

What does a push do in Gitkraken?

The Git push command takes the changes you've made on your local machine and updates your remote repository to reflect those changes. Developers use this command to update their remote repository in order to share the most accurate Git history with project collaborators.

How do I push local changes to my remote repository?

Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.

What does force push do in git?

The --force option for git push allows you to override this rule: the commit history on the remote will be forcefully overwritten with your own local history. This is a rather dangerous process, because it's very easy to overwrite (and thereby lose) commits from your colleagues.


1 Answers

I have never used Gitkraken before, but I just tried to replicate your scenario. I I just typed origin/master and clicked on submit and gitkraken automatically created the branch. I tried with an new repo on Bitbucket, but I think this should work with GitLab as well.

Steps I followed:

  1. Create empty repository in bitbucket
  2. Clone that empty repository in my local with gitkraken UI (click on the folder icon on top left, choose clone and follow the steps). This created my local repository and a remote named origin
  3. Pushed the local "master" branch from git kraken
  4. In the place to enter the remote, I just entered origin/master (till now I don't have the master branch in my remote repository), after clicking submit, I could see the master branch in my remote.

I see your remote is named Gitlab, can you please also try with Gitlab/master, please note that the repository name can be case sensitive.

like image 88
dubes Avatar answered Oct 13 '22 00:10

dubes