Sven
Sven

Reputation: 13296

Git/Git Flow: My commited files don't appear on GitHub?

I am new to Git and soon have to work with a team that uses the Git Flow branching model. While I have understood the theory behind that model pretty well, I am struggling how to get it running for the project.

Here are the commands I am using to set up a small (example) project:

git flow init

touch test.txt

git add test.txt

git remote add origin https://github.com/****/some-repository.git

git commit -m "just a test"

git push -u origin master

The code above is expected to push the created file "test.txt" to the master branch on the remote, but that does not happen.
All commands are executed without any errors, but taking a look at the GitHub page for that repository it appears to be empty.

One possible cause could be that I am not using a release, hotfix or feature branch but instead work in the develop branch on my machine. On the other hand this does not make sense to me since I just want to set up my project with it's core files, not develop a feature, doing a hotfix or releasing something.

Maybe I am missing some command? Why doesn't my file appear in the repository?

Upvotes: 0

Views: 131

Answers (1)

Chris
Chris

Reputation: 137070

The origin and master parts of git push -u origin master indicate that you want to push

  • the master branch
  • to the origin remote.

If you're working in develop and you want to share that branch you'll want to push the develop branch instead.

Try git push -u origin develop initially to set your local branch up to track the remote one, and then just git push origin develop afterwards.

Upvotes: 2

Related Questions