Posts

Showing posts with the label git

github commands quick reference

Get into a repo and commit code there. Scenario 1: If you have your NEW empty github or other git repo ready:- cd "/your/repo/dir" git clone https://github.com/user_AKA_you/repoName # (creates /your/repo/dir/repoName) cp "/all/your/existing/code/*" "/your/repo/dir/repoName/" git add -A git commit -m "initial commit" git push origin master Scenario 2: If you have an existing local git repo cd "/your/repo/dir/repoName" #add your remote github or other git repo git remote set-url origin https://github.com/user_AKA_you/your_repoName git commit -m "new origin commit" git push origin master Delete a file from the repo git rm file1.txt git commit -m "remove file1.txt" Reference: 1 , 2