This is an old revision of the document!
Make the clone at the remote repository.
git clone email@example.com:dblume/get-shit-done
git remote add upstream git://github.com/icambridge/get-shit-done
Enter a comment for the commit. See section 2.7.2 here.
git commit -a
Double checking the alias names…
$ git remote -v origin firstname.lastname@example.org:dblume/get-shit-done (fetch) origin email@example.com:dblume/get-shit-done (push) upstream git://github.com/icambridge/get-shit-done (fetch) upstream git://github.com/icambridge/get-shit-done (push)
The push that worked from within the local directory:
git push origin
From the parent directory:
git clone https://github.com/realpython/interview-questions.git python-interview cd python-interview
1. Check which files are staged for commit.
2. Then, when you're ready to commit locally,
git commit -a -m "Some useful comment"
3. When you're ready to push a local commit to a remote one…
git push -u origin master
git push https://github.com/dblume/netflix-dvd-feed
I created hexbright-factory at https://github.com/new. Then, to create a new repository on the command line at the local computer:
touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/dblume/hexbright-factory.git git push -u origin master
I created wine-tasting at https://github.com/new. Then, to create a new repository on the command line at the local computer:
~$ mkdir wine-tasting ~$ cd wine-tasting/ wine-tasting$ vim README.md wine-tasting$ vim LICENSE.txt wine-tasting$ git init wine-tasting$ git add README.md wine-tasting$ git add LICENSE.txt wine-tasting$ git add test.py wine-tasting$ git add wine_allocator.py wine-tasting$ git commit -m "first commit" wine-tasting$ git remote add origin https://github.com/dblume/wine-tasting.git wine-tasting$ git push -u origin master
To rename a remote branch (where “origin” is the name of the remote repo):
When someone else renamed a remote branch:
$ git fetch --all # TODO investigate why fetch $ git remote prune origin # (where origin is the name of the shared repo)
Now I should see “remotes/origin/roku_dev” gone, and “remotes/origin/SDK_4.2.P2_Roku” appear.
I still have a local branch called “roku_dev” and it's set to track “remotes/origin/roku_dev”. Since “remotes/origin/roku_dev” is no longer there, if I try “git pull” on that branch it will say remote reference doesn't exist.
Since I don't have any changes on that local branch that I haven't pushed up to the server before the name change, I can safely delete this local branch, and create a new local branch from “remotes/origin/SDK_4.2.P2_Roku”.