I\'ve done 1-2, and I\'ve tracked the file in 3. I do not understand how to \"re
ID: 3743390 • Letter: I
Question
I've done 1-2, and I've tracked the file in 3. I do not understand how to "register our file (in git bash) to our local repository history, before sychronizing our local history with the Github remote repositry".
We're doing this with a Git Bash and we have a git hub repostriy set up. Clear commands as an example would be apperciated. Again:
1) How to register our file in local repository history
2) Syncing local history with Github remote repositry
Explanation / Answer
I have demonstrated all the steps and posted the output from git bash also
before creating README.md can check the status about files
$git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
step 1 and 2
creating the readme.md file
$vim README.md
$
now if you check the status you will get 1 untracked file that is not added to git repository
$git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
README.md
nothing added to commit but untracked files present (use "git add" to track)
step 3
now git add will staged the new file repository for tracking
git add <FILENAME>
$git add README.md
now file has been staged
now if you check the git status you will get mesage like new file : <name of file>
$git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: README.md
now che need to recored so git commit will do it
it generated a commit id that is unique now file has been added lo local repository
$git commit -m "added readme"
[master bb1a2bb] added readme
1 file changed, 1 insertion(+)
create mode 100644 README.md
$
now for saving the same changes to remote repository we need to push local changes to remote server
it can be done by command
git push <REMOTE NAME> <name of branch>
$
$git push origin master
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.