Sample app for git tutorial
this is a test repo for practice with push/pull/clone ect.. with gitbash.
anyone is free to practice git with this repo PR’s will all be accepted.
Adding directions and bash terminal “info/output”
helpful links if you have problems pushing code
answers to ERRORS i encountered
echo “# git-Tutorial-repo” >> README.md
git init
git add README.md
git commit -m “first commit”
git remote add origin
git push -u origin master
OR
git remote add origin https://github.com/singhofen/git-Tutorial-repo.git
git push -u origin master
https://stackoverflow.com/questions/20939648/issue-pushing-new-code-in-github
https://github.com/rtyley/bfg-repo-cleaner/issues/29
Dont push your newly created branch to master unsless you are done with changes and making files for current project
$ git checkout -b testBranch
Switched to a new branch ‘testBranch’
$ touch testBranch.html
$ git status
On branch testBranch
Untracked files:
(use “git add
testBranch.html
nothing added to commit but untracked files present (use “git add” to track)
$ git add testBranch.html
$ git status
On branch testBranch
Changes to be committed:
(use “git reset HEAD
new file: testBranch.html
$ git commit -m ‘added test branch’
[testBranch 7b2a1a9] added test branch
1 file changed, 26 insertions(+)
create mode 100644 testBranch.html
$ git status
On branch testBranch
nothing to commit, working tree clean
$ git push
fatal: The current branch testBranch has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin testBranch
$ git push —set-upstream origin testBranch
$ git status
On branch testBranch
Your branch is up-to-date with ‘origin/testBranch’.
$ touch test.txt
$ git status
On branch testBranch
Your branch is up-to-date with ‘origin/testBranch’.
Untracked files:
(use “git add
test.txt
nothing added to commit but untracked files present (use “git add” to track)
$ git add .
$ git status
On branch testBranch
Your branch is up-to-date with ‘origin/testBranch’.
Changes to be committed:
(use “git reset HEAD
new file: test.txt
$ git commit -m ‘added test txt file’
[testBranch c5c7f1c] added test txt file
1 file changed, 5 insertions(+)
create mode 100644 test.txt
$ git push
$ git checkout master
Switched to branch ‘master’
Your branch is up-to-date with ‘origin/master’.
$ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
nothing to commit, working tree clean
$ git push -f origin master <—will force push to github but may lose all previous files
$ touch README.md
$ git add .
$ git status
On branch master
Changes to be committed:
(use “git reset HEAD
new file: README.md
$ git commit -m ‘edited readme’
[master 95d7c99] edited readme
1 file changed, 4 insertions(+)
create mode 100644 README.md
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
$ git push —set-upstream origin master
fatal: HttpRequestException encountered.
$ git pull
Already up-to-date.
$ touch git-test.html
$ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Untracked files:
(use “git add
git-test.html
nothing added to commit but untracked files present (use “git add” to track)
$ git add .
$ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
(use “git reset HEAD
new file: git-test.html
$ git commit -m ‘added git test file’
[master 72d8ea2] added git test file
1 file changed, 16 insertions(+)
create mode 100644 git-test.html
$ git push
$ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes not staged for commit:
(use “git add
(use “git checkout —
modified: README.md
no changes added to commit (use “git add” and/or “git commit -a”)
$ git commit -m ‘edited readme file’
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes not staged for commit:
modified: README.md
no changes added to commit
$ git add .
$ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
Changes to be committed:
(use “git reset HEAD
modified: README.md
$ git commit -m ‘edited readme file’
[master 2a0bc00] edited readme file
1 file changed, 2 insertions(+), 2 deletions(-)
$ git push