-1

I know this is probably a stupid question, but what is the exact command to push changes to a remote repository?

If the remote repo is: https://github.com/Project/Example.git

The Branch is: development

and the local folder is: CPRender

I've tried: git push https://github.com/Project/Example.git development

This did not work.

Gilan 101
  • 11
  • 1
  • I recommend you follow some Git introductory tutorials instead, so that you have a better understanding of how git works overall, rather than getting a quick answer to this specific problem - otherwise you'll have a patchwork/swiss-cheese mental-model of git, which won't help you. – Dai Feb 03 '21 at 08:16
  • 1
    https://guides.github.com/ – jonrsharpe Feb 03 '21 at 08:17
  • @Dai I've used sourcetree with bitbucket in the past and understand how git works, but I'm just starting to use github with command line controls for git now. It's basically just the syntax I'm looking for. – Gilan 101 Feb 03 '21 at 08:28

2 Answers2

0

The normal command should be:

git push -u origin development

Assuming that you have clone the remote repository.

You should see:

git remote -v
https://github.com/Project/Example.git
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I just tried that command. I see the following: Branch 'development' set up to track remote branch 'development' from 'origin'. Everything up-to-date The github repository doesn't seem to have been updated either. – Gilan 101 Feb 03 '21 at 08:24
  • @Gilan101 Looking good: your local branch is now linked to the remote tracking branch origin/development, as expected. See also https://stackoverflow.com/q/4693588/6309 – VonC Feb 03 '21 at 08:25
  • Just had a look at that link. Does this mean I just use 'git push' from within the branch now to push changes to the remote repository? – Gilan 101 Feb 03 '21 at 08:31
  • @Gilan101 Exactly. – VonC Feb 03 '21 at 08:36
  • Hmm. It just says 'Everything up to date', even though I know I've added 11 files to the branch. Is the command different if I'm adding new files, rather than modifying existing ones? – Gilan 101 Feb 03 '21 at 08:40
  • @Gilan101 Adding is not enough, you need to git commit first, then push. See https://rogerdudler.github.io/git-guide/ – VonC Feb 03 '21 at 08:41
0

-----at first make a remote : git remote add git remote add origin https://github.com/Project/Example.git

-----now you have your remote now commite your last changes now time to push git push git push origin development

ali lotfi
  • 11
  • 2