-1

I wanted to work on remote github repository from multiple machines, on my laptop it works as intended, however on my PC i can't connect my local branch to remote branch. Maybe they are connected but, when i try to commit message pops up saying that there is nothing to commit even though i made some changes? I did git clone of remote repository, then i did git fetch, then i did git checkout myRemoteRepositoryName.

Message when i try to commit:

Your branch is up to date with 'origin/myBranch'.

My question is how do I contribute to my remote branch from another PC?

Veljkoza
  • 11
  • 5

1 Answers1

0

type git status if it shows a ton of red, that means nothing is staged. Type in git add then the directory you want to stage. Once you have some content staged then type:

git commit -m "message goes here"

then you will commit to your local branch, now you can push your changes with:

git push origin myBranch
Matti Greff
  • 178
  • 5
  • `nothing is staged` - Do you mean there is something unstaged/deleted? – dan1st Mar 31 '20 at 20:31
  • Nope, when you make changes with git you have to first stage them, then commit them. after that you can push that branch to it's remote counterpart. @dan1st – Matti Greff Mar 31 '20 at 20:35
  • There could also be something that is staged if there is a bunch of red stuff. I do only think the *nothing* is not accurate. – dan1st Mar 31 '20 at 20:43
  • It makes more sense in the context of the question, as OP has nothing staged. – krisz Mar 31 '20 at 20:48
  • git status On branch mybranch Your branch is up to date with 'origin/mybranch'. nothing to commit, working tree clean – Veljkoza Mar 31 '20 at 20:49
  • this is the message that i get, but could there be problem with my credentials? i did git config username and email, but nowhere was i asked for password – Veljkoza Mar 31 '20 at 20:51
  • 1
    Did you save the file in your editor? Are you sure you are editing the files in the repo? – krisz Mar 31 '20 at 20:53
  • yeap this was it, i had auto save on laptop but not on pc, i feel dumb now, thanks guys – Veljkoza Mar 31 '20 at 21:03