Skip to content
Bob Lee edited this page Apr 18, 2019 · 1 revision

Welcome to the twabler wiki!

Making Changes in a Forked Repo and Pushing a Commit

Clone the fork to your machine.

(base) user@linux:~/osp$ git clone https://github.com/bleeeeee/twabler.git
Cloning into 'twabler'...
remote: Enumerating objects: 70, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 70 (delta 7), reused 58 (delta 4), pack-reused 0
Unpacking objects: 100% (70/70), done.
Checking connectivity... done.

List currently configured remote repo for the fork.

(base) user@linux:~/osp$ cd twabler/
(base) user@linux:~/osp/twabler$ git remote -v
origin	https://github.com/bleeeeee/twabler.git (fetch)
origin	https://github.com/bleeeeee/twabler.git (push)

Add the upstream repo to the configuration and verify.

(base) user@linux:~/osp/twabler$ git remote add upstream https://github.com/sfbrigade/twabler.git
(base) user@linux:~/osp/twabler$ git remote -v
origin	https://github.com/bleeeeee/twabler.git (fetch)
origin	https://github.com/bleeeeee/twabler.git (push)
upstream	https://github.com/sfbrigade/twabler.git (fetch)
upstream	https://github.com/sfbrigade/twabler.git (push)

Configure your credentials for persistent storage. With an unmodified local copy of your fork, do a push. This will trigger git to ask for credentials and store them in ~/.git-credentials

(base) user@linux:~/osp/twabler$ git config credential.helper store
(base) user@linux:~/osp/twabler$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': bleeeeee
Password for 'https://[email protected]': 
Everything up-to-date

At this point all of your configuration is complete. Code as you need to. In this case, we'll make a branch on our fork and make changes there.

(base) user@linux:~/osp/twabler$ cd mobile/
android/ ios/     
(base) user@linux:~/osp/twabler$ cd mobile/android/
(base) user@linux:~/osp/twabler/mobile/android$ ls
README.md
(base) user@linux:~/osp/twabler/mobile/android$ git checkout -b tine
Switched to a new branch 'tine'
(base) user@linux:~/osp/twabler/mobile/android$ vi README.md 

Show changes made in branch 'tine'

(base) user@linux:~/osp/twabler/mobile/android$ git diff
diff --git a/mobile/android/README.md b/mobile/android/README.md
index 04893da..30b8708 100644
--- a/mobile/android/README.md
+++ b/mobile/android/README.md
@@ -1 +1 @@
-# Android Version
\ No newline at end of file
+# Android Version!
(base) user@linux:~/osp/twabler/mobile/android$ git status
On branch tine
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Add the changed file to the index and record changes to the repo.

(base) user@linux:~/osp/twabler/mobile/android$ git add README.md 
(base) user@linux:~/osp/twabler/mobile/android$ git commit -m "added exclamation point"
[tine 3db90b2] added exclamation point
 1 file changed, 1 insertion(+), 1 deletion(-)
(base) user@linux:~/osp/twabler/mobile/android$ git push origin tine
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 401 bytes | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/bleeeeee/twabler.git
   5058803..3db90b2  tine -> tine
(base) user@linux:~/osp/twabler/mobile/android$

Now What?

The changes are pushed. You can

  • Leave it as it is
  • Have someone with merge rights in the upstream repo merge it
  • Make a pull request
Clone this wiki locally