Last active
December 1, 2019 00:26
-
-
Save supriya-premkumar/fd9a1aaacace992372fdf1eb9880b11f to your computer and use it in GitHub Desktop.
Revisions
-
supriya-premkumar revised this gist
Dec 1, 2019 . 1 changed file with 44 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,4 +20,47 @@ > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) > upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) > upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) **Create a new branch** ``` 1. git checkout master 2. git pull origin master #updates the local master 3. git checkout -b <feature branch> ``` **Rebase** ``` 1. git checkout master 2. git pull origin master 3. git checkout <feature branch> 4. git rebase -i master ``` **Squash commits** ``` 5. %s/pick/s/g ``` **Edit commit** ``` 1. git commit --amend ``` **Resolve Merge Conflicts** ``` 1. Resolve merge conflicts 2. git add -A 3. git rebase --continue 4. git push s <feature branch> 5. <create a PR From:s/<feature branch> To: origin/master > 6. Once the PR is merged a. git checkout master b. git pull origin master c. git push —delete s <feature branch> $delete remote branch d. git branch -D <local branch name> #delete local branch e. git push origin --delete <remote branch> #delete remote branch ``` -
supriya-premkumar revised this gist
Dec 1, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ $ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git 3. Verify new forked remote repo addition in the previous step git remote -v > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) -
supriya-premkumar revised this gist
Dec 1, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ **Configure a remote for a fork** 1. List configured current repository git remote -v -
supriya-premkumar revised this gist
Dec 1, 2019 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,23 @@ Configure a remote for a fork 1. List configured current repository git remote -v > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) 2. Configuring remote for a fork git remote add <give- name-for-fork-repo> <forked ssh url> $ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git 3. Verify new forked remote repo added in the previous step git remote -v > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) > upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) > upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
-
supriya-premkumar created this gist
Dec 1, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ Configure a remote for a fork 1. List configured current repository `git remote -v` ``` > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) ``` 2. Configuring remote for a fork `git remote add <give- name-for-fork-repo> <forked ssh url> ` ``` $ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git ``` 3. Verify new forked remote repo added in the previous step ``` $ git remote -v > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) > origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) > upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) > upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) ```