Changes between Version 2 and Version 3 of Csle2022/Agenda/githubadministration
- Timestamp:
- Nov 12, 2022, 8:49:12 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Csle2022/Agenda/githubadministration
v2 v3 46 46 === Add a new file to the repo === 47 47 48 ==== From web UI ==== 49 48 50 1.On GitHub.com, navigate to the main page of the repository. 49 51 50 52 2.Above the list of files, using the Add file drop-down, click Upload files. 51 53 52 [[Image(https://ws.learn.ac.lk/ attachment/wiki/Csle2022/Agenda/githubadministration/upload-files-button.png, 600)]]54 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/upload-files-button.png, 600)]] 53 55 54 56 3.Drag and drop the file or folder you'd like to upload to your repository onto the file tree. 55 57 56 [[Image(https://ws.learn.ac.lk/ attachment/wiki/Csle2022/Agenda/githubadministration/upload-files-drag-and-drop.png, 600)]]58 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/upload-files-drag-and-drop.png, 600)]] 57 59 58 60 4.At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file. You can attribute the commit to more than one author in the commit message. 59 61 60 [[Image(https://ws.learn.ac.lk/ attachment/wiki/Csle2022/Agenda/githubadministration/write-commit-message-quick-pull.png, 600)]]62 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/write-commit-message-quick-pull.png, 600)]] 61 63 62 64 5.Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is the default branch, you should choose to create a new branch for your commit and then create a pull request. 63 65 64 [[Image(https://ws.learn.ac.lk/ attachment/wiki/Csle2022/Agenda/githubadministration/choose-commit-branch.png, 600)]]66 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/choose-commit-branch.png, 600)]] 65 67 66 68 6.Click Commit changes. 67 69 68 [[Image(https://ws.learn.ac.lk/attachment/wiki/Csle2022/Agenda/githubadministration/commit-changes-button.png, 600)]] 70 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/commit-changes-button.png, 600)]] 71 72 ==== From the terminal ==== 73 74 1.On your computer, move the file you'd like to upload to GitHub into the local directory that was created when you cloned the repository. 75 76 2.Open Terminal. 77 78 3.Change the current working directory to your local repository. 79 80 4.Stage the file for commit to your local repository. 81 82 {{{ 83 $ git add . 84 # Adds the file to your local repository and stages it for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'. 85 }}} 86 87 5.Commit the file that you've staged in your local repository. 88 89 {{{ 90 $ git commit -m "Add existing file" 91 # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again. 92 }}} 93 94 6.Push the changes in your local repository to GitHub.com. 95 96 {{{ 97 $ git push origin YOUR_BRANCH 98 # Pushes the changes in your local repository up to the remote repository you specified as the origin 99 }}} 69 100 70 101 === Add a file to the staging environment === 71 102 103 The "add" command marks changes to be included in the next commit. 104 105 It adds changes to Git's "Staging Area", the contents of which can then be wrapped up in a new revision with the "git commit" command. 106 107 You can provide one or multiple paths and thereby add changes in these files to the Staging Area: 108 109 `git add file1 file2` 110 111 These changes will then be part of the next commit. 112 113 In case you want all current modifications in your project to be added to the Staging Area (including deletions and new files), you can simply use "--all" or "-A": 114 115 `git add --all` 116 72 117 === Create a commit === 118 119 Commits are the building blocks of "save points" within Git's version control. 120 121 `git commit -m "update the README.md"` 122 73 123 === Create a branch === 74 === Create a new repo on Github === 124 125 ==== From web GUI ==== 126 127 1.On GitHub.com, navigate to the main page of the repository. 128 129 2.Above the list of files, click Branches. 130 131 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/branches-overview-link-2.png, 600)]] 132 133 3.Click New branch. 134 135 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/new-branch-button.png, 600)]] 136 137 4.In the dialog box, enter the branch name and optionally change the branch source. 138 If the repository is a fork, you also have the option to select the upstream repository as the branch source. 139 140 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/branch-creation-popup-branch-source.png, 600)]] 141 142 5.Click Create branch. 143 144 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/branch-creation-popup-button.png, 600)]] 145 146 ==== Creating a branch using the branch dropdown ==== 147 148 1.On GitHub.com, navigate to the main page of the repository. 149 150 2. Optionally, if you want to create the new branch from a branch other than the default branch of the repository, click Branches then choose another branch. 151 152 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/branches-overview-link-3.png, 600)]] 153 154 3.Click the branch selector menu. 155 156 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/branch-selection-dropdown.png, 600)]] 157 158 4.Type a unique name for your new branch, then select Create branch. 159 160 [[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/githubadministration/branch-creation-text-box.png, 600)]] 161 75 162 === Push a branch to GitHub === 76 163 === Create a pull request ===